[saco] Implement CPlayerPed::StartGoggles()

This commit is contained in:
RD42 committed 2024-05-03 22:10:08 +08:00
1 parent f6211221c4
commit 9894fd3ec7
2 files changed
+15

No files matched your search

+14
View File
@@ -2,6 +2,7 @@
#include "../main.h"
#include "util.h"
#include "keystuff.h"
#include "task.h"
extern CGame *pGame;
@@ -165,6 +166,19 @@ WEAPON_SLOT_TYPE * CPlayerPed::FindWeaponSlot(DWORD dwWeapon)
//-----------------------------------------------------------
void CPlayerPed::StartGoggles()
{
if (HasGoggles()) return;
if (FindWeaponSlot( 44 ) == NULL && FindWeaponSlot( 45 ) == NULL)
GiveWeapon( 44, 1 ); // Prevents crashing due to lack of animations.
CTaskGoggles* pGoggles = new CTaskGoggles();
pGoggles->ApplyToPed( this );
m_bGoggleState = TRUE;
}
//-----------------------------------------------------------
void CPlayerPed::StopGoggles()
{
if (!m_pPed || !HasGoggles()) return;
+1
View File
@@ -23,6 +23,7 @@ public:
WEAPON_SLOT_TYPE * GetCurrentWeaponSlot();
WEAPON_SLOT_TYPE * FindWeaponSlot(DWORD dwWeapon);
void StartGoggles();
void StopGoggles();
BOOL HasGoggles();