@@ -165,24 +165,24 @@ class CClientPed : public CClientStreamElement, public CAntiCheatModule
165
165
CClientPed (CClientManager* pManager, unsigned long ulModelID, ElementID ID);
166
166
~CClientPed ();
167
167
168
- void Unlink (){};
168
+ void Unlink () {};
169
169
170
170
virtual eClientEntityType GetType () const { return CCLIENTPED; }
171
171
172
- CPlayerPed* GetGamePlayer () { return m_pPlayerPed; }
173
- CEntity* GetGameEntity () { return m_pPlayerPed; }
174
- const CEntity* GetGameEntity () const { return m_pPlayerPed; }
172
+ CPlayerPed* GetGamePlayer () noexcept { return m_pPlayerPed; }
173
+ CEntity* GetGameEntity () noexcept { return m_pPlayerPed; }
174
+ const CEntity* GetGameEntity () const noexcept { return m_pPlayerPed; }
175
175
176
- bool IsLocalPlayer () { return m_bIsLocalPlayer; }
177
- bool IsSyncing () { return m_bIsSyncing; }
176
+ bool IsLocalPlayer () const noexcept { return m_bIsLocalPlayer; }
177
+ bool IsSyncing () const noexcept { return m_bIsSyncing; }
178
178
void SetSyncing (bool bIsSyncing);
179
179
180
180
bool GetMatrix (CMatrix& Matrix) const ;
181
181
bool SetMatrix (const CMatrix& Matrix);
182
182
virtual CSphere GetWorldBoundingSphere ();
183
183
184
184
void GetPosition (CVector& vecPosition) const ;
185
- void SetPosition (const CVector& vecPosition) { SetPosition (vecPosition, true , true ); }
185
+ void SetPosition (const CVector& vecPosition) noexcept { SetPosition (vecPosition, true , true ); }
186
186
void SetPosition (const CVector& vecPosition, bool bResetInterpolation, bool bAllowGroundLoadFreeze = true );
187
187
188
188
void SetInterior (unsigned char ucInterior);
@@ -231,19 +231,24 @@ class CClientPed : public CClientStreamElement, public CAntiCheatModule
231
231
232
232
void SetTargetTarget (unsigned long ulDelay, const CVector& vecSource, const CVector& vecTarget);
233
233
234
- int GetVehicleInOutState () { return m_iVehicleInOutState; };
235
- void SetVehicleInOutState (int iState) { m_iVehicleInOutState = iState; };
234
+ int GetVehicleInOutState () const noexcept { return m_iVehicleInOutState; };
235
+ void SetVehicleInOutState (int iState) noexcept { m_iVehicleInOutState = iState; };
236
236
237
- unsigned long GetModel () { return m_ulModel; };
237
+ unsigned long GetModel () const noexcept { return m_ulModel; };
238
238
bool SetModel (unsigned long ulModel, bool bTemp = false );
239
239
240
240
bool GetCanBeKnockedOffBike ();
241
241
void SetCanBeKnockedOffBike (bool bCanBeKnockedOffBike);
242
242
243
- bool IsInVehicle () { return GetOccupiedVehicle () != NULL ; };
244
- CClientVehicle* GetOccupiedVehicle () { return m_pOccupiedVehicle; };
245
- unsigned int GetOccupiedVehicleSeat () { return m_uiOccupiedVehicleSeat; };
246
- CClientVehicle* GetOccupyingVehicle () { return m_pOccupyingVehicle; };
243
+ bool IsInVehicle () const noexcept { return GetOccupiedVehicle () != NULL ; };
244
+
245
+ CClientVehicle* GetOccupiedVehicle () noexcept { return m_pOccupiedVehicle; };
246
+ const CClientVehicle* GetOccupiedVehicle () const noexcept { return m_pOccupiedVehicle; };
247
+
248
+ unsigned int GetOccupiedVehicleSeat () const noexcept { return m_uiOccupiedVehicleSeat; };
249
+
250
+ CClientVehicle* GetOccupyingVehicle () noexcept { return m_pOccupyingVehicle; };
251
+ const CClientVehicle* GetOccupyingVehicle () const noexcept { return m_pOccupyingVehicle; };
247
252
248
253
CClientVehicle* GetRealOccupiedVehicle ();
249
254
CClientVehicle* GetClosestEnterableVehicle (bool bGetPositionFromClosestDoor, bool bCheckDriverDoor, bool bCheckPassengerDoors,
@@ -274,21 +279,21 @@ class CClientPed : public CClientStreamElement, public CAntiCheatModule
274
279
275
280
void LockHealth (float fHealth );
276
281
void LockArmor (float fArmor );
277
- void UnlockHealth () { m_bHealthLocked = false ; };
278
- void UnlockArmor () { m_bArmorLocked = false ; };
279
- bool IsHealthLocked () const { return m_bHealthLocked; };
280
- bool IsArmorLocked () const { return m_bArmorLocked; };
282
+ void UnlockHealth () noexcept { m_bHealthLocked = false ; };
283
+ void UnlockArmor () noexcept { m_bArmorLocked = false ; };
284
+ bool IsHealthLocked () const noexcept { return m_bHealthLocked; };
285
+ bool IsArmorLocked () const noexcept { return m_bArmorLocked; };
281
286
282
287
bool IsDying ();
283
288
bool IsDead ();
284
- void SetIsDead (bool bDead) { m_bDead = bDead; };
289
+ void SetIsDead (bool bDead) noexcept { m_bDead = bDead; };
285
290
void Kill (eWeaponType weaponType, unsigned char ucBodypart, bool bStealth = false , bool bSetDirectlyDead = false , AssocGroupId animGroup = 0 ,
286
291
AnimationId animID = 15 );
287
292
void StealthKill (CClientPed* pPed);
288
293
void BeHit (CClientPed* pClientPedAttacker, ePedPieceTypes hitBodyPart, int hitBodySide, int weaponId);
289
294
290
- int GetRespawnState () { return m_pRespawnState; };
291
- void SetRespawnState (int iRespawnState) { m_pRespawnState = iRespawnState; };
295
+ int GetRespawnState () const noexcept { return m_pRespawnState; };
296
+ void SetRespawnState (int iRespawnState) noexcept { m_pRespawnState = iRespawnState; };
292
297
293
298
CWeapon* GiveWeapon (eWeaponType weaponType, unsigned int uiAmmo, bool bSetAsCurrent = false );
294
299
bool SetCurrentWeaponSlot (eWeaponSlot weaponSlot);
@@ -328,9 +333,9 @@ class CClientPed : public CClientStreamElement, public CAntiCheatModule
328
333
}
329
334
};
330
335
CVector GetAim () const ;
331
- const CVector& GetAimSource () { return m_shotSyncData->m_vecShotOrigin ; };
332
- const CVector& GetAimTarget () { return m_shotSyncData->m_vecShotTarget ; };
333
- eVehicleAimDirection GetVehicleAimAnim () { return m_shotSyncData->m_cInVehicleAimDirection ; };
336
+ const CVector& GetAimSource () const noexcept { return m_shotSyncData->m_vecShotOrigin ; };
337
+ const CVector& GetAimTarget () const noexcept { return m_shotSyncData->m_vecShotTarget ; };
338
+ eVehicleAimDirection GetVehicleAimAnim () const noexcept { return m_shotSyncData->m_cInVehicleAimDirection ; };
334
339
void SetAim (float fArmDirectionX , float fArmDirectionY , eVehicleAimDirection cInVehicleAimAnim);
335
340
void SetAimInterpolated (unsigned long ulDelay, float fArmDirectionX , float fArmDirectionY , bool bAkimboAimUp, eVehicleAimDirection cInVehicleAimAnim);
336
341
void SetAimingData (unsigned long ulDelay, const CVector& vecTargetPosition, float fArmDirectionX , float fArmDirectionY ,
@@ -356,7 +361,8 @@ class CClientPed : public CClientStreamElement, public CAntiCheatModule
356
361
float GetStat (unsigned short usStat);
357
362
void ResetStats ();
358
363
359
- CClientPlayerClothes* GetClothes () { return m_pClothes; }
364
+ CClientPlayerClothes* GetClothes () noexcept { return m_pClothes; }
365
+ const CClientPlayerClothes* GetClothes () const noexcept { return m_pClothes; }
360
366
361
367
// This is kinda hacky, should be private but something depends on this. Should depend on some
362
368
// streamer func. Perhaps use SetNeverStreamOut, but need something to reset that.
@@ -375,13 +381,14 @@ class CClientPed : public CClientStreamElement, public CAntiCheatModule
375
381
bool IsOnGround ();
376
382
377
383
bool IsClimbing ();
378
- bool IsRadioOn () { return m_bRadioOn; };
384
+ bool IsRadioOn () const noexcept { return m_bRadioOn; };
379
385
void NextRadioChannel ();
380
386
void PreviousRadioChannel ();
381
387
bool SetCurrentRadioChannel (unsigned char ucChannel);
382
- unsigned char GetCurrentRadioChannel () { return m_ucRadioChannel; };
388
+ unsigned char GetCurrentRadioChannel () const noexcept { return m_ucRadioChannel; };
383
389
384
- CTaskManager* GetTaskManager () { return m_pTaskManager; }
390
+ CTaskManager* GetTaskManager () noexcept { return m_pTaskManager; }
391
+ const CTaskManager* GetTaskManager () const noexcept { return m_pTaskManager; }
385
392
386
393
bool GetShotData (CVector* pvecOrigin, CVector* pvecTarget = NULL , CVector* pvecGunMuzzle = NULL , CVector* pvecFireOffset = NULL , float * fAimX = NULL ,
387
394
float * fAimY = NULL );
@@ -399,10 +406,14 @@ class CClientPed : public CClientStreamElement, public CAntiCheatModule
399
406
std::list<CClientProjectile*>::iterator ProjectilesEnd () { return m_Projectiles.end (); }
400
407
unsigned int CountProjectiles (eWeaponType weaponType = WEAPONTYPE_UNARMED);
401
408
409
+ std::list<CClientProjectile*>& GetProjectiles () noexcept { return m_Projectiles; }
410
+ const std::list<CClientProjectile*>& GetProjectiles () const noexcept { return m_Projectiles; }
411
+
402
412
void RemoveAllProjectiles ();
403
413
void DestroySatchelCharges (bool bBlow = true , bool bDestroy = true );
404
414
405
- CRemoteDataStorage* GetRemoteData () { return m_remoteDataStorage; }
415
+ CRemoteDataStorage* GetRemoteData () noexcept { return m_remoteDataStorage; }
416
+ const CRemoteDataStorage* GetRemoteData () const noexcept { return m_remoteDataStorage; }
406
417
407
418
bool IsEnteringVehicle ();
408
419
bool IsLeavingVehicle ();
@@ -416,11 +427,12 @@ class CClientPed : public CClientStreamElement, public CAntiCheatModule
416
427
417
428
float GetDistanceFromCentreOfMassToBaseOfModel ();
418
429
419
- unsigned char GetAlpha () { return m_ucAlpha; }
430
+ unsigned char GetAlpha () const noexcept { return m_ucAlpha; }
420
431
void SetAlpha (unsigned char ucAlpha);
421
432
422
- bool HasTargetPosition () { return (m_interp.pos .ulFinishTime != 0 ); }
423
- CClientEntity* GetTargetOriginSource () { return m_interp.pTargetOriginSource ; }
433
+ bool HasTargetPosition () const noexcept { return m_interp.pos .ulFinishTime != 0 ; }
434
+ CClientEntity* GetTargetOriginSource () noexcept { return m_interp.pTargetOriginSource ; }
435
+ const CClientEntity* GetTargetOriginSource () const noexcept { return m_interp.pTargetOriginSource ; }
424
436
void GetTargetPosition (CVector& vecPosition);
425
437
void SetTargetPosition (const CVector& vecPosition, unsigned long ulDelay, CClientEntity* pTargetOriginSource = NULL );
426
438
void RemoveTargetPosition ();
@@ -430,8 +442,9 @@ class CClientPed : public CClientStreamElement, public CAntiCheatModule
430
442
CClientEntity* GetTargetedEntity ();
431
443
CClientPed* GetTargetedPed ();
432
444
433
- CClientEntity* GetCurrentContactEntity () { return m_pCurrentContactEntity; }
434
- void SetCurrentContactEntity (CClientEntity* pEntity) { m_pCurrentContactEntity = pEntity; }
445
+ CClientEntity* GetCurrentContactEntity () noexcept { return m_pCurrentContactEntity; }
446
+ const CClientEntity* GetCurrentContactEntity () const noexcept { return m_pCurrentContactEntity; }
447
+ void SetCurrentContactEntity (CClientEntity* pEntity) noexcept { m_pCurrentContactEntity = pEntity; }
435
448
436
449
bool IsSunbathing ();
437
450
void SetSunbathing (bool bSunbathing, bool bStartStanding = true );
@@ -453,22 +466,22 @@ class CClientPed : public CClientStreamElement, public CAntiCheatModule
453
466
bool bOffsetPed = false , bool bHoldLastFrame = false );
454
467
void KillAnimation ();
455
468
std::unique_ptr<CAnimBlock> GetAnimationBlock ();
456
- const SAnimationCache& GetAnimationCache () { return m_AnimationCache; }
469
+ const SAnimationCache& GetAnimationCache () const noexcept { return m_AnimationCache; }
457
470
458
471
bool IsUsingGun ();
459
472
460
- bool IsHeadless () { return m_bHeadless; }
473
+ bool IsHeadless () const noexcept { return m_bHeadless; }
461
474
void SetHeadless (bool bHeadless);
462
475
463
- bool IsFrozen () const { return m_bFrozen; }
476
+ bool IsFrozen () const noexcept { return m_bFrozen; }
464
477
void SetFrozen (bool bFrozen);
465
478
bool IsFrozenWaitingForGroundToLoad () const ;
466
479
void SetFrozenWaitingForGroundToLoad (bool bFrozen);
467
480
468
481
bool IsFootBloodEnabled ();
469
482
void SetFootBloodEnabled (bool bHasFootBlood);
470
483
471
- bool IsBleeding () const { return m_bBleeding; };
484
+ bool IsBleeding () const noexcept { return m_bBleeding; };
472
485
void SetBleeding (bool bBleeding);
473
486
474
487
bool IsOnFire ();
@@ -502,27 +515,33 @@ class CClientPed : public CClientStreamElement, public CAntiCheatModule
502
515
std::unique_ptr<CAnimBlendAssociation> GetFirstAnimation ();
503
516
504
517
void DereferenceCustomAnimationBlock () { m_pCustomAnimationIFP = nullptr ; }
505
- std::shared_ptr<CClientIFP> GetCustomAnimationIFP () { return m_pCustomAnimationIFP; }
506
- bool IsCustomAnimationPlaying () { return ((m_bRequestedAnimation || m_AnimationCache.bLoop ) && m_pAnimationBlock && m_bisCurrentAnimationCustom); }
507
- void SetCustomAnimationUntriggerable ()
518
+ std::shared_ptr<CClientIFP> GetCustomAnimationIFP () const noexcept { return m_pCustomAnimationIFP; }
519
+ bool IsCustomAnimationPlaying () noexcept
520
+ {
521
+ return (m_bRequestedAnimation || m_AnimationCache.bLoop )
522
+ && m_pAnimationBlock && m_bisCurrentAnimationCustom;
523
+ }
524
+ void SetCustomAnimationUntriggerable () noexcept
508
525
{
509
526
m_bRequestedAnimation = false ;
510
527
m_AnimationCache.bLoop = false ;
511
528
}
512
- bool IsNextAnimationCustom () { return m_bisNextAnimationCustom; }
529
+ bool IsNextAnimationCustom () const noexcept { return m_bisNextAnimationCustom; }
513
530
void SetNextAnimationCustom (const std::shared_ptr<CClientIFP>& pIFP, const SString& strAnimationName);
514
- void SetCurrentAnimationCustom (bool bCustom) { m_bisCurrentAnimationCustom = bCustom; }
515
- bool IsCurrentAnimationCustom () { return m_bisCurrentAnimationCustom; }
516
- CIFPAnimations* GetIFPAnimationsPointer () { return m_pIFPAnimations; }
517
- void SetIFPAnimationsPointer (CIFPAnimations* pIFPAnimations) { m_pIFPAnimations = pIFPAnimations; }
531
+ void SetCurrentAnimationCustom (bool bCustom) noexcept { m_bisCurrentAnimationCustom = bCustom; }
532
+ bool IsCurrentAnimationCustom () const noexcept { return m_bisCurrentAnimationCustom; }
533
+ CIFPAnimations* GetIFPAnimationsPointer () noexcept { return m_pIFPAnimations; }
534
+ const CIFPAnimations* GetIFPAnimationsPointer () const noexcept { return m_pIFPAnimations; }
535
+
536
+ void SetIFPAnimationsPointer (CIFPAnimations* pIFPAnimations) noexcept { m_pIFPAnimations = pIFPAnimations; }
518
537
519
538
// This will indicate that we have played custom animation, so next animation can be internal GTA animation
520
539
// You must call this function after playing a custom animation
521
- void SetNextAnimationNormal () { m_bisNextAnimationCustom = false ; }
522
- const SString& GetNextAnimationCustomBlockName () { return m_strCustomIFPBlockName; }
523
- const SString& GetNextAnimationCustomName () { return m_strCustomIFPAnimationName; }
524
- const unsigned int & GetCustomAnimationBlockNameHash () { return m_u32CustomBlockNameHash; }
525
- const unsigned int & GetCustomAnimationNameHash () { return m_u32CustomAnimationNameHash; }
540
+ void SetNextAnimationNormal () noexcept { m_bisNextAnimationCustom = false ; }
541
+ const SString& GetNextAnimationCustomBlockName () const noexcept { return m_strCustomIFPBlockName; }
542
+ const SString& GetNextAnimationCustomName () const noexcept { return m_strCustomIFPAnimationName; }
543
+ const unsigned int & GetCustomAnimationBlockNameHash () const noexcept { return m_u32CustomBlockNameHash; }
544
+ const unsigned int & GetCustomAnimationNameHash () const noexcept { return m_u32CustomAnimationNameHash; }
526
545
527
546
void ReplaceAnimation (std::unique_ptr<CAnimBlendHierarchy>& pInternalAnimHierarchy, const std::shared_ptr<CClientIFP>& pIFP,
528
547
CAnimBlendHierarchySAInterface* pCustomAnimHierarchy);
@@ -579,13 +598,13 @@ class CClientPed : public CClientStreamElement, public CAntiCheatModule
579
598
580
599
void Respawn (CVector* pvecPosition = NULL , bool bRestoreState = false , bool bCameraCut = false );
581
600
582
- void SetTaskToBeRestoredOnAnimEnd (bool bSetOnEnd) { m_bTaskToBeRestoredOnAnimEnd = bSetOnEnd; }
583
- bool IsTaskToBeRestoredOnAnimEnd () { return m_bTaskToBeRestoredOnAnimEnd; }
584
- void SetTaskTypeToBeRestoredOnAnimEnd (eTaskType taskType) { m_eTaskTypeToBeRestoredOnAnimEnd = taskType; }
585
- eTaskType GetTaskTypeToBeRestoredOnAnimEnd () { return m_eTaskTypeToBeRestoredOnAnimEnd; }
601
+ void SetTaskToBeRestoredOnAnimEnd (bool bSetOnEnd) noexcept { m_bTaskToBeRestoredOnAnimEnd = bSetOnEnd; }
602
+ bool IsTaskToBeRestoredOnAnimEnd () const noexcept { return m_bTaskToBeRestoredOnAnimEnd; }
603
+ void SetTaskTypeToBeRestoredOnAnimEnd (eTaskType taskType) noexcept { m_eTaskTypeToBeRestoredOnAnimEnd = taskType; }
604
+ eTaskType GetTaskTypeToBeRestoredOnAnimEnd () const noexcept { return m_eTaskTypeToBeRestoredOnAnimEnd; }
586
605
587
- bool IsWarpInToVehicleRequired () { return m_bWarpInToVehicleRequired; }
588
- void SetWarpInToVehicleRequired (bool warp) { m_bWarpInToVehicleRequired = warp; }
606
+ bool IsWarpInToVehicleRequired () const noexcept { return m_bWarpInToVehicleRequired; }
607
+ void SetWarpInToVehicleRequired (bool warp) noexcept { m_bWarpInToVehicleRequired = warp; }
589
608
590
609
void NotifyCreate ();
591
610
void NotifyDestroy ();
0 commit comments