File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed
Server/mods/deathmatch/logic Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -1568,6 +1568,9 @@ void CMultiplayerSA::InitHooks()
1568
1568
MemSet ((void *)0x7225F5 , 0x90 , 4 );
1569
1569
MemCpy ((void *)0x725DDE , " \xFF\x76\xB\x90\x90 " , 5 );
1570
1570
1571
+ // Allow switch weapon during jetpack task (#3569)
1572
+ MemSetFast ((void *)0x60D86F , 0x90 , 19 );
1573
+
1571
1574
InitHooks_CrashFixHacks ();
1572
1575
1573
1576
// Init our 1.3 hooks.
Original file line number Diff line number Diff line change @@ -534,3 +534,25 @@ void CPed::SetJackingVehicle(CVehicle* pVehicle)
534
534
if (m_pJackingVehicle)
535
535
m_pJackingVehicle->SetJackingPed (this );
536
536
}
537
+
538
+ void CPed::SetHasJetPack (bool bHasJetPack)
539
+ {
540
+ if (m_bHasJetPack == bHasJetPack)
541
+ return ;
542
+
543
+ m_bHasJetPack = bHasJetPack;
544
+
545
+ if (!bHasJetPack)
546
+ return ;
547
+
548
+ // Set weapon slot to 0 if weapon is disabled with jetpack to avoid HUD and audio bugs
549
+ eWeaponType weaponType = static_cast <eWeaponType>(GetWeaponType (GetWeaponSlot ()));
550
+ if (weaponType <= WEAPONTYPE_UNARMED)
551
+ return ;
552
+
553
+ bool weaponEnabled;
554
+ CStaticFunctionDefinitions::GetJetpackWeaponEnabled (weaponType, weaponEnabled);
555
+
556
+ if (!weaponEnabled)
557
+ CStaticFunctionDefinitions::SetPedWeaponSlot (this , 0 );
558
+ }
Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ class CPed : public CElement
188
188
static const char * GetBodyPartName (unsigned char ucID);
189
189
190
190
bool HasJetPack () { return m_bHasJetPack; }
191
- void SetHasJetPack (bool bHasJetPack) { m_bHasJetPack = bHasJetPack; }
191
+ void SetHasJetPack (bool bHasJetPack);
192
192
193
193
bool IsInWater () { return m_bInWater; }
194
194
void SetInWater (bool bInWater) { m_bInWater = bInWater; }
You can’t perform that action at this time.
0 commit comments