diff --git a/plugin_sa/game_sa/CEntity.h b/plugin_sa/game_sa/CEntity.h index 5c741c73..2ebb7374 100644 --- a/plugin_sa/game_sa/CEntity.h +++ b/plugin_sa/game_sa/CEntity.h @@ -26,42 +26,42 @@ class PLUGIN_API CEntity : public CPlaceable { struct RpAtomic *m_pRwAtomic; }; /* https://code.google.com/p/mtasa-blue/source/browse/trunk/MTA10/game_sa/CEntitySA.h */ - unsigned int bUsesCollision : 1; // does entity use collision - unsigned int bCollisionProcessed : 1; // has object been processed by a ProcessEntityCollision function - unsigned int bIsStatic : 1; // is entity static - unsigned int bHasContacted : 1; // has entity processed some contact forces - unsigned int bIsStuck : 1; // is entity stuck - unsigned int bIsInSafePosition : 1; // is entity in a collision free safe position - unsigned int bWasPostponed : 1; // was entity control processing postponed - unsigned int bIsVisible : 1; //is the entity visible - - unsigned int bIsBIGBuilding : 1; // Set if this entity is a big building - unsigned int bRenderDamaged : 1; // use damaged LOD models for objects with applicable damage - unsigned int bStreamingDontDelete : 1; // Dont let the streaming remove this - unsigned int bRemoveFromWorld : 1; // remove this entity next time it should be processed - unsigned int bHasHitWall : 1; // has collided with a building (changes subsequent collisions) - unsigned int bImBeingRendered : 1; // don't delete me because I'm being rendered - unsigned int bDrawLast :1; // draw object last - unsigned int bDistanceFade :1; // Fade entity because it is far away - - unsigned int bDontCastShadowsOn : 1; // Dont cast shadows on this object - unsigned int bOffscreen : 1; // offscreen flag. This can only be trusted when it is set to true - unsigned int bIsStaticWaitingForCollision : 1; // this is used by script created entities - they are static until the collision is loaded below them - unsigned int bDontStream : 1; // tell the streaming not to stream me - unsigned int bUnderwater : 1; // this object is underwater change drawing order - unsigned int bHasPreRenderEffects : 1; // Object has a prerender effects attached to it - unsigned int bIsTempBuilding : 1; // whether or not the building is temporary (i.e. can be created and deleted more than once) - unsigned int bDontUpdateHierarchy : 1; // Don't update the aniamtion hierarchy this frame - - unsigned int bHasRoadsignText : 1; // entity is roadsign and has some 2deffect text stuff to be rendered - unsigned int bDisplayedSuperLowLOD : 1; - unsigned int bIsProcObject : 1; // set object has been generate by procedural object generator - unsigned int bBackfaceCulled : 1; // has backface culling on - unsigned int bLightObject : 1; // light object with directional lights - unsigned int bUnimportantStream : 1; // set that this object is unimportant, if streaming is having problems - unsigned int bTunnel : 1; // Is this model part of a tunnel - unsigned int bTunnelTransition : 1; // This model should be rendered from within and outside of the tunnel - /* */ + bool bUsesCollision : 1; // does entity use collision + bool bCollisionProcessed : 1; // has object been processed by a ProcessEntityCollision function + bool bIsStatic : 1; // is entity static + bool bHasContacted : 1; // has entity processed some contact forces + bool bIsStuck : 1; // is entity stuck + bool bIsInSafePosition : 1; // is entity in a collision free safe position + bool bWasPostponed : 1; // was entity control processing postponed + bool bIsVisible : 1; // is the entity visible + + bool bIsBIGBuilding : 1; // Set if this entity is a big building + bool bRenderDamaged : 1; // use damaged LOD models for objects with applicable damage + bool bStreamingDontDelete : 1; // don't let the streaming remove this + bool bRemoveFromWorld : 1; // remove this entity next time it should be processed + bool bHasHitWall : 1; // has collided with a building (changes subsequent collisions) + bool bImBeingRendered : 1; // don't delete me because I'm being rendered + bool bDrawLast :1; // draw object last + bool bDistanceFade :1; // fade entity because it is far away + + bool bDontCastShadowsOn : 1; // dont cast shadows on this object + bool bOffscreen : 1; // offscreen flag. This can only be trusted when it is set to true + bool bIsStaticWaitingForCollision : 1; // this is used by script created entities - they are static until the collision is loaded below them + bool bDontStream : 1; // tell the streaming not to stream me + bool bUnderwater : 1; // this object is underwater change drawing order + bool bHasPreRenderEffects : 1; // object has a prerender effects attached to it + bool bIsTempBuilding : 1; // whether or not the building is temporary (i.e. can be created and deleted more than once) + bool bDontUpdateHierarchy : 1; // don't update the aniamtion hierarchy this frame + + bool bHasRoadsignText : 1; // entity is roadsign and has some 2deffect text stuff to be rendered + bool bDisplayedSuperLowLOD : 1; + bool bIsProcObject : 1; // set object has been generate by procedural object generator + bool bBackfaceCulled : 1; // has backface culling on + bool bLightObject : 1; // light object with directional lights + bool bUnimportantStream : 1; // set that this object is unimportant, if streaming is having problems + bool bTunnel : 1; // is this model part of a tunnel + bool bTunnelTransition : 1; // this model should be rendered from within and outside of the tunnel + unsigned short m_nRandomSeed; unsigned short m_nModelIndex; CReference *m_pReferences; @@ -75,8 +75,8 @@ class PLUGIN_API CEntity : public CPlaceable { }; unsigned char m_nNumLodChildren; unsigned char m_nNumLodChildrenRendered; - unsigned char m_nType : 3; // see eEntityType - unsigned char m_nStatus : 5; // see eEntityStatus + eEntityType m_nType : 3; + eEntityStatus m_nStatus : 5; // originally virtual functions void Add(CRect &rect); diff --git a/plugin_sa/game_sa/CPed.cpp b/plugin_sa/game_sa/CPed.cpp index 71961de1..c0abb95e 100644 --- a/plugin_sa/game_sa/CPed.cpp +++ b/plugin_sa/game_sa/CPed.cpp @@ -761,10 +761,10 @@ void CPed::SayScript(int arg0, unsigned char arg1, unsigned char arg2, unsigned ((void (__thiscall *)(CPed*, int, unsigned char, unsigned char, unsigned char))0x5EFFB0)(this, arg0, arg1, arg2, arg3); } -// Converted from thiscall void CPed::Say(ushort,uint,float,uchar,uchar,uchar) 0x5EFFE0 -void CPed::Say(unsigned short arg0, unsigned int arg1, float arg2, unsigned char arg3, unsigned char arg4, unsigned char arg5) +// Converted from thiscall unsigned short CPed::Say(ushort,uint,float,uchar,uchar,uchar) 0x5EFFE0 +unsigned short CPed::Say(unsigned short gCtx, unsigned int startTimeDelay, float probability, bool overrideSilence, bool isForceAudible, bool isFrontEnd) { - ((void (__thiscall *)(CPed*, unsigned short, unsigned int, float, unsigned char, unsigned char, unsigned char))0x5EFFE0)(this, arg0, arg1, arg2, arg3, arg4, arg5); + return ((unsigned short (__thiscall *)(CPed*, unsigned short, unsigned int, float, bool, bool, bool))0x5EFFE0)(this, gCtx, startTimeDelay, probability, overrideSilence, isForceAudible, isFrontEnd); } // Converted from cdecl RwObject* SetPedAtomicVisibilityCB(RwObject *rwObject,void *data) 0x5F0060 diff --git a/plugin_sa/game_sa/CPed.h b/plugin_sa/game_sa/CPed.h index 897b1a04..fe4811a0 100644 --- a/plugin_sa/game_sa/CPed.h +++ b/plugin_sa/game_sa/CPed.h @@ -39,7 +39,7 @@ enum PLUGIN_API eMoveState { PEDMOVE_SPRINT }; -enum PLUGIN_API eFightingStyle +enum PLUGIN_API eFightingStyle : char { STYLE_STANDARD = 4, STYLE_BOXING, @@ -66,150 +66,153 @@ class PLUGIN_API CPed : public CPhysical { plugin::dummy, plugin::dummy, plugin::dummy } { } public: - CAEPedAudioEntity m_pedAudio; - CAEPedSpeechAudioEntity m_pedSpeech; - CAEWeaponAudioEntity m_weaponAudio; + CAEPedAudioEntity m_pedAudio; + CAEPedSpeechAudioEntity m_pedSpeech; + CAEWeaponAudioEntity m_weaponAudio; char field_43C[36]; - char field_460[8]; + CPed* m_roadRageWith; + char field_464[4]; int field_468; /* https://code.google.com/p/mtasa-blue/source/browse/tags/1.3.4/MTA10/game_sa/CPedSA.h */ - unsigned int bIsStanding : 1; // is ped standing on something - unsigned int bWasStanding : 1; // was ped standing on something - unsigned int bIsLooking : 1; // is ped looking at something or in a direction - unsigned int bIsRestoringLook : 1; // is ped restoring head postion from a look - unsigned int bIsAimingGun : 1; // is ped aiming gun - unsigned int bIsRestoringGun : 1; // is ped moving gun back to default posn - unsigned int bCanPointGunAtTarget : 1; // can ped point gun at target - unsigned int bIsTalking : 1; // is ped talking(see Chat()) - - unsigned int bInVehicle : 1; // is in a vehicle - unsigned int bIsInTheAir : 1; // is in the air - unsigned int bIsLanding : 1; // is landing after being in the air - unsigned int bHitSomethingLastFrame : 1; // has been in a collision last fram - unsigned int bIsNearCar : 1; // has been in a collision last fram - unsigned int bRenderPedInCar : 1; // has been in a collision last fram - unsigned int bUpdateAnimHeading : 1; // update ped heading due to heading change during anim sequence - unsigned int bRemoveHead : 1; // waiting on AntiSpazTimer to remove head - - unsigned int bFiringWeapon : 1; // is pulling trigger - unsigned int bHasACamera : 1; // does ped possess a camera to document accidents - unsigned int bPedIsBleeding : 1; // Ped loses a lot of blood if true - unsigned int bStopAndShoot : 1; // Ped cannot reach target to attack with fist, need to use gun - unsigned int bIsPedDieAnimPlaying : 1; // is ped die animation finished so can dead now - unsigned int bStayInSamePlace : 1; // when set, ped stays put - unsigned int bKindaStayInSamePlace : 1; // when set, ped doesn't seek out opponent or cover large distances. Will still shuffle and look for cover - unsigned int bBeingChasedByPolice : 1; // use nodes for routefind - - unsigned int bNotAllowedToDuck : 1; // Is this ped allowed to duck at all? - unsigned int bCrouchWhenShooting : 1; // duck behind cars etc - unsigned int bIsDucking : 1; // duck behind cars etc - unsigned int bGetUpAnimStarted : 1; // don't want to play getup anim if under something - unsigned int bDoBloodyFootprints : 1; // unsigned int bIsLeader :1; - unsigned int bDontDragMeOutCar : 1; - unsigned int bStillOnValidPoly : 1; // set if the polygon the ped is on is still valid for collision - unsigned int bAllowMedicsToReviveMe : 1; - - unsigned int bResetWalkAnims : 1; - unsigned int bOnBoat : 1; // flee but only using nodes - unsigned int bBusJacked : 1; // flee but only using nodes - unsigned int bFadeOut : 1; // set if you want ped to fade out - unsigned int bKnockedUpIntoAir : 1; // has ped been knocked up into the air by a car collision - unsigned int bHitSteepSlope : 1; // has ped collided/is standing on a steep slope (surface type) - unsigned int bCullExtraFarAway : 1; // special ped only gets culled if it's extra far away (for roadblocks) - unsigned int bTryingToReachDryLand : 1; // has ped just exited boat and trying to get to dry land - - unsigned int bCollidedWithMyVehicle : 1; - unsigned int bRichFromMugging : 1; // ped has lots of cash cause they've been mugging people - unsigned int bChrisCriminal : 1; // Is a criminal as killed during Chris' police mission (should be counted as such) - unsigned int bShakeFist : 1; // test shake hand at look entity - unsigned int bNoCriticalHits : 1; // ped cannot be killed by a single bullet - unsigned int bHasAlreadyBeenRecorded : 1; // Used for replays - unsigned int bUpdateMatricesRequired : 1; // if PedIK has altered bones so matrices need updated this frame - unsigned int bFleeWhenStanding : 1; // - - unsigned int bMiamiViceCop : 1; // - unsigned int bMoneyHasBeenGivenByScript : 1; // - unsigned int bHasBeenPhotographed : 1; // - unsigned int bIsDrowning : 1; - unsigned int bDrownsInWater : 1; - unsigned int bHeadStuckInCollision : 1; - unsigned int bDeadPedInFrontOfCar : 1; - unsigned int bStayInCarOnJack : 1; - - unsigned int bDontFight : 1; - unsigned int bDoomAim : 1; - unsigned int bCanBeShotInVehicle : 1; - unsigned int bPushedAlongByCar : 1; // ped is getting pushed along by car collision (so don't take damage from horz velocity) - unsigned int bNeverEverTargetThisPed : 1; - unsigned int bThisPedIsATargetPriority : 1; - unsigned int bCrouchWhenScared : 1; - unsigned int bKnockedOffBike : 1; - - unsigned int bDonePositionOutOfCollision : 1; - unsigned int bDontRender : 1; - unsigned int bHasBeenAddedToPopulation : 1; - unsigned int bHasJustLeftCar : 1; - unsigned int bIsInDisguise : 1; - unsigned int bDoesntListenToPlayerGroupCommands : 1; - unsigned int bIsBeingArrested : 1; - unsigned int bHasJustSoughtCover : 1; - - unsigned int bKilledByStealth : 1; - unsigned int bDoesntDropWeaponsWhenDead : 1; - unsigned int bCalledPreRender : 1; - unsigned int bBloodPuddleCreated : 1; // Has a static puddle of blood been created yet - unsigned int bPartOfAttackWave : 1; - unsigned int bClearRadarBlipOnDeath : 1; - unsigned int bNeverLeavesGroup : 1; // flag that we want to test 3 extra spheres on col model - unsigned int bTestForBlockedPositions : 1; // this sets these indicator flags for various posisions on the front of the ped - - unsigned int bRightArmBlocked : 1; - unsigned int bLeftArmBlocked : 1; - unsigned int bDuckRightArmBlocked : 1; - unsigned int bMidriffBlockedForJump : 1; - unsigned int bFallenDown : 1; - unsigned int bUseAttractorInstantly : 1; - unsigned int bDontAcceptIKLookAts : 1; - unsigned int bHasAScriptBrain : 1; - - unsigned int bWaitingForScriptBrainToLoad : 1; - unsigned int bHasGroupDriveTask : 1; - unsigned int bCanExitCar : 1; - unsigned int CantBeKnockedOffBike : 2; // 0=Default(harder for mission peds) 1=Never 2=Always normal(also for mission peds) - unsigned int bHasBeenRendered : 1; - unsigned int bIsCached : 1; - unsigned int bPushOtherPeds : 1; // GETS RESET EVERY FRAME - SET IN TASK: want to push other peds around (eg. leader of a group or ped trying to get in a car) - - unsigned int bHasBulletProofVest : 1; - unsigned int bUsingMobilePhone : 1; - unsigned int bUpperBodyDamageAnimsOnly : 1; - unsigned int bStuckUnderCar : 1; - unsigned int bKeepTasksAfterCleanUp : 1; // If true ped will carry on with task even after cleanup - unsigned int bIsDyingStuck : 1; - unsigned int bIgnoreHeightCheckOnGotoPointTask : 1; // set when walking round buildings, reset when task quits - unsigned int bForceDieInCar : 1; - - unsigned int bCheckColAboveHead : 1; - unsigned int bIgnoreWeaponRange : 1; - unsigned int bDruggedUp : 1; - unsigned int bWantedByPolice : 1; // if this is set, the cops will always go after this ped when they are doing a KillCriminal task - unsigned int bSignalAfterKill : 1; - unsigned int bCanClimbOntoBoat : 1; - unsigned int bPedHitWallLastFrame : 1; // useful to store this so that AI knows (normal will still be available) - unsigned int bIgnoreHeightDifferenceFollowingNodes : 1; - - unsigned int bMoveAnimSpeedHasBeenSetByTask : 1; - unsigned int bGetOutUpsideDownCar : 1; - unsigned int bJustGotOffTrain : 1; - unsigned int bDeathPickupsPersist : 1; - unsigned int bTestForShotInVehicle : 1; - unsigned int bUsedForReplay : 1; // This ped is controlled by replay and should be removed when replay is done. +#pragma pack(push, 1) + bool bIsStanding : 1; // is ped standing on something + bool bWasStanding : 1; // was ped standing on something + bool bIsLooking : 1; // is ped looking at something or in a direction + bool bIsRestoringLook : 1; // is ped restoring head postion from a look + bool bIsAimingGun : 1; // is ped aiming gun + bool bIsRestoringGun : 1; // is ped moving gun back to default posn + bool bCanPointGunAtTarget : 1;// can ped point gun at target + bool bIsTalking : 1; // is ped talking(see Chat()) + + bool bInVehicle : 1; // is in a vehicle + bool bIsInTheAir : 1; // is in the air + bool bIsLanding : 1; // is landing after being in the air + bool bHitSomethingLastFrame : 1; // has been in a collision last fram + bool bIsNearCar : 1; // has been in a collision last fram + bool bRenderPedInCar : 1; // has been in a collision last fram + bool bUpdateAnimHeading : 1; // update ped heading due to heading change during anim sequence + bool bRemoveHead : 1; // waiting on AntiSpazTimer to remove head + + bool bFiringWeapon : 1; // is pulling trigger + bool bHasACamera : 1; // does ped possess a camera to document accidents + bool bPedIsBleeding : 1; // ped loses a lot of blood if true + bool bStopAndShoot : 1; // ped cannot reach target to attack with fist, need to use gun + bool bIsPedDieAnimPlaying : 1;// is ped die animation finished so can dead now + bool bStayInSamePlace : 1; // when set, ped stays put + bool bKindaStayInSamePlace : 1; // when set, ped doesn't seek out opponent or cover large distances. Will still shuffle and look for cover + bool bBeingChasedByPolice : 1;// use nodes for routefind + + bool bNotAllowedToDuck : 1; // ss this ped allowed to duck at all? + bool bCrouchWhenShooting : 1; // duck behind cars etc + bool bIsDucking : 1; // duck behind cars etc + bool bGetUpAnimStarted : 1; // don't want to play getup anim if under something + bool bDoBloodyFootprints : 1; // bool bIsLeader :1; + bool bDontDragMeOutCar : 1; + bool bStillOnValidPoly : 1; // set if the polygon the ped is on is still valid for collision + bool bAllowMedicsToReviveMe : 1; + + bool bResetWalkAnims : 1; + bool bOnBoat : 1; // flee but only using nodes + bool bBusJacked : 1; // flee but only using nodes + bool bFadeOut : 1; // set if you want ped to fade out + bool bKnockedUpIntoAir : 1; // has ped been knocked up into the air by a car collision + bool bHitSteepSlope : 1; // has ped collided/is standing on a steep slope (surface type) + bool bCullExtraFarAway : 1; // special ped only gets culled if it's extra far away (for roadblocks) + bool bTryingToReachDryLand : 1; // has ped just exited boat and trying to get to dry land + + bool bCollidedWithMyVehicle : 1; + bool bRichFromMugging : 1; // ped has lots of cash cause they've been mugging people + bool bChrisCriminal : 1; // is a criminal as killed during Chris' police mission (should be counted as such) + bool bShakeFist : 1; // test shake hand at look entity + bool bNoCriticalHits : 1; // ped cannot be killed by a single bullet + bool bHasAlreadyBeenRecorded : 1; // used for replays + bool bUpdateMatricesRequired : 1; // if PedIK has altered bones so matrices need updated this frame + bool bFleeWhenStanding : 1; + + bool bMiamiViceCop : 1; + bool bMoneyHasBeenGivenByScript : 1; + bool bHasBeenPhotographed : 1; + bool bIsDrowning : 1; + bool bDrownsInWater : 1; + bool bHeadStuckInCollision : 1; + bool bDeadPedInFrontOfCar : 1; + bool bStayInCarOnJack : 1; + + bool bDontFight : 1; + bool bDoomAim : 1; + bool bCanBeShotInVehicle : 1; + bool bPushedAlongByCar : 1; // ped is getting pushed along by car collision (so don't take damage from horz velocity) + bool bNeverEverTargetThisPed : 1; + bool bThisPedIsATargetPriority : 1; + bool bCrouchWhenScared : 1; + bool bKnockedOffBike : 1; + + bool bDonePositionOutOfCollision : 1; + bool bDontRender : 1; + bool bHasBeenAddedToPopulation : 1; + bool bHasJustLeftCar : 1; + bool bIsInDisguise : 1; + bool bDoesntListenToPlayerGroupCommands : 1; + bool bIsBeingArrested : 1; + bool bHasJustSoughtCover : 1; + + bool bKilledByStealth : 1; + bool bDoesntDropWeaponsWhenDead : 1; + bool bCalledPreRender : 1; + bool bBloodPuddleCreated : 1; // has a static puddle of blood been created yet + bool bPartOfAttackWave : 1; + bool bClearRadarBlipOnDeath : 1; + bool bNeverLeavesGroup : 1; // flag that we want to test 3 extra spheres on col model + bool bTestForBlockedPositions : 1; // this sets these indicator flags for various posisions on the front of the ped + + bool bRightArmBlocked : 1; + bool bLeftArmBlocked : 1; + bool bDuckRightArmBlocked : 1; + bool bMidriffBlockedForJump : 1; + bool bFallenDown : 1; + bool bUseAttractorInstantly : 1; + bool bDontAcceptIKLookAts : 1; + bool bHasAScriptBrain : 1; + + bool bWaitingForScriptBrainToLoad : 1; + bool bHasGroupDriveTask : 1; + bool bCanExitCar : 1; + unsigned char CantBeKnockedOffBike : 2; // 0=Default(harder for mission peds) 1=Never 2=Always normal(also for mission peds) + bool bHasBeenRendered : 1; + bool bIsCached : 1; + bool bPushOtherPeds : 1; // GETS RESET EVERY FRAME - SET IN TASK: want to push other peds around (eg. leader of a group or ped trying to get in a car) + + bool bHasBulletProofVest : 1; + bool bUsingMobilePhone : 1; + bool bUpperBodyDamageAnimsOnly : 1; + bool bStuckUnderCar : 1; + bool bKeepTasksAfterCleanUp : 1; // if true ped will carry on with task even after cleanup + bool bIsDyingStuck : 1; + bool bIgnoreHeightCheckOnGotoPointTask : 1; // set when walking round buildings, reset when task quits + bool bForceDieInCar : 1; + + bool bCheckColAboveHead : 1; + bool bIgnoreWeaponRange : 1; + bool bDruggedUp : 1; + bool bWantedByPolice : 1; // if this is set, the cops will always go after this ped when they are doing a KillCriminal task + bool bSignalAfterKill : 1; + bool bCanClimbOntoBoat : 1; + bool bPedHitWallLastFrame : 1; // useful to store this so that AI knows (normal will still be available) + bool bIgnoreHeightDifferenceFollowingNodes : 1; + + bool bMoveAnimSpeedHasBeenSetByTask : 1; + bool bGetOutUpsideDownCar : 1; + bool bJustGotOffTrain : 1; + bool bDeathPickupsPersist : 1; + bool bTestForShotInVehicle : 1; + bool bUsedForReplay : 1; // this ped is controlled by replay and should be removed when replay is done +#pragma pack(pop) CPedIntelligence *m_pIntelligence; CPlayerData *m_pPlayerData; unsigned char m_nCreatedBy; - char field_485[3]; + char field_485[3]; // padding AnimBlendFrameData *m_apBones[19]; unsigned int m_nAnimGroup; CVector2D m_vecAnimMovingShiftLocal; @@ -218,35 +221,35 @@ class PLUGIN_API CPed : public CPhysical { RwFrame *m_pGunflashObject; RwObject *m_pGogglesObject; unsigned char *m_pGogglesState; - short m_nWeaponGunflashAlphaMP1; - short field_506; - short m_nWeaponGunflashAlphaMP2; - short field_50A; + short m_nWeaponGunflashAlphaMP1; // AKA m_nWeaponGunflashStateRightHand + short m_nWeaponGunFlashAlphaProgMP1; + short m_nWeaponGunflashAlphaMP2; // AKA m_nWeaponGunflashStateLeftHand + short m_nWeaponGunFlashAlphaProgMP2; CPedIK m_pedIK; - int field_52C; - ePedState m_ePedState; // see ePedState - int m_nMoveState; - int field_538; - int field_53C; + int m_nAntiSpazTimer; + ePedState m_ePedState; + eMoveState m_nMoveState; + eMoveState m_nSwimmingMoveState; // used for swimming in CTaskSimpleSwim::ProcessPed + int field_53C; float m_fHealth; float m_fMaxHealth; float m_fArmour; - int field_54C; + unsigned int m_nTimeTillWeNeedThisPed; CVector2D m_vecAnimMovingShift; float m_fCurrentRotation; float m_fAimingRotation; float m_fHeadingChangeRate; - int field_564; - int field_568; + int m_fMoveAnim; + CEntity* m_standingOnEntity; CVector field_56C; CVector field_578; - CEntity *m_pContactEntity; + CEntity* m_pContactEntity; float field_588; - CVehicle *m_pVehicle; - int field_590; + CVehicle* m_pVehicle; + CVehicle* m_VehDeadInFrontOf; // set if bDeadPedInFrontOfCar int field_594; int m_nPedType; - void *m_pStats; // CPedStat * + void* m_pStats; // CPedStat * CWeapon m_aWeapons[13]; eWeaponType m_nSavedWeapon; // when we need to hide ped weapon, we save it temporary here eWeaponType m_nDelayedWeapon; // 'delayed' weapon is like an additional weapon, f.e., simple cop has a nitestick as current and pistol as delayed weapons @@ -254,41 +257,41 @@ class PLUGIN_API CPed : public CPhysical { unsigned char m_nSelectedWepSlot; unsigned char m_nWeaponShootingRate; unsigned char m_nWeaponAccuracy; - CObject *m_pTargetedObject; + CObject* m_pTargetedObject; // lock-on target int field_720; int field_724; int field_728; char m_nWeaponSkill; - char m_nFightingStyle; // see eFightingStyle + eFightingStyle m_nFightingStyle; char m_nAllowedAttackMoves; char field_72F; - CFire *m_pFire; - int field_734; - int field_738; - int field_73C; + CFire* m_pFire; + float m_fireDmgMult; + CEntity* m_pLookTarget; + float m_fLookDirection; // radians int m_nWeaponModelId; - int field_744; - int field_748; - int field_74C; + unsigned int m_nUnconsciousTimer; + unsigned int m_nLookTime; + unsigned int m_nAttackTimer; int m_nDeathTime; char m_nBodypartToRemove; char field_755; short m_nMoneyCount; - int field_758; - int field_75C; - char m_nLastWeaponDamage; - CEntity *m_pLastEntityDamage; + float m_Wobble; + float m_WobbleSpeed; + eWeaponType m_nLastWeaponDamage; + CEntity* m_pLastEntityDamage; int field_768; CVector m_vecTurretOffset; float m_fTurretAngleA; float m_fTurretAngleB; int m_nTurretPosnMode; int m_nTurretAmmo; - void *m_pCoverPoint; // CCoverPoint * - void *m_pEnex; // CEnEx * + void* m_pCoverPoint; // CCoverPoint * + void* m_pEnex; // CEnEx * float m_fRemovalDistMultiplier; // 1.0 by default - short m_nSpecialModelIndex; - char field_796[2]; + short m_StreamedScriptBrainToLoad; + char field_796[2]; // padding int field_798; // class virtual functions @@ -303,7 +306,7 @@ class PLUGIN_API CPed : public CPhysical { // class functions - CPed(ePedType); + CPed(ePedType); bool PedIsInvolvedInConversation(); bool PedIsReadyForConversation(bool arg0); bool PedCanPickUpPickUp(); @@ -428,7 +431,7 @@ class PLUGIN_API CPed : public CPhysical { void EnablePedSpeechForScriptSpeech(); void CanPedHoldConversation(); void SayScript(int arg0, unsigned char arg1, unsigned char arg2, unsigned char arg3); - void Say(unsigned short arg0, unsigned int arg1, float arg2, unsigned char arg3, unsigned char arg4, unsigned char arg5); + unsigned short Say(unsigned short gCtx, unsigned int startTimeDelay = 0, float probability = 1.0f, bool overrideSilence = false, bool isForceAudible = false, bool isFrontEnd = false); void RemoveBodyPart(int boneId, char localDir); void SpawnFlyingComponent(int arg0, char arg1); bool DoesLOSBulletHitPed(CColPoint& colPoint); @@ -437,7 +440,7 @@ class PLUGIN_API CPed : public CPhysical { void KillPedWithCar(CVehicle* car, float arg1, bool arg2); void MakeTyresMuddySectorList(CPtrList& ptrList); void DeadPedMakesTyresBloody(); - void SetModelIndex(unsigned int modelIndex); + void SetModelIndex(unsigned int modelIndex); public: inline CWeapon* GetWeapon() { diff --git a/plugin_sa/game_sa/CPhysical.cpp b/plugin_sa/game_sa/CPhysical.cpp index aa3192b3..ce078b9f 100644 --- a/plugin_sa/game_sa/CPhysical.cpp +++ b/plugin_sa/game_sa/CPhysical.cpp @@ -47,10 +47,10 @@ void CPhysical::ApplyTurnForce(CVector dir, CVector velocity) ((void (__thiscall *)(CPhysical*, CVector, CVector))0x542A50)(this, dir, velocity); } -// Converted from thiscall void CPhysical::ApplyForce(CVector dir,CVector velocity,bool flag) 0x542B50 -void CPhysical::ApplyForce(CVector dir, CVector velocity, bool flag) +// Converted from thiscall void CPhysical::ApplyForce(CVector dir,CVector velocity,bool bUpdateTurnSpeed) 0x542B50 +void CPhysical::ApplyForce(CVector dir, CVector velocity, bool bUpdateTurnSpeed) { - ((void (__thiscall *)(CPhysical*, CVector, CVector, bool))0x542B50)(this, dir, velocity, flag); + ((void (__thiscall *)(CPhysical*, CVector, CVector, bool))0x542B50)(this, dir, velocity, bUpdateTurnSpeed); } // Converted from thiscall CVector CPhysical::GetSpeed(CVector direction) 0x542CE0 @@ -122,15 +122,15 @@ bool CPhysical::GetHasCollidedWithAnyObject() } // Converted from thiscall bool CPhysical::ApplyCollision(CEntity *entity,CColPoint &colPoint,float &) 0x5435C0 -bool CPhysical::ApplyCollision(CEntity* entity, CColPoint& colPoint, float& arg2) +bool CPhysical::ApplyCollision(CEntity* entity, CColPoint& colPoint, float& outDamageIntensity) { - return ((bool (__thiscall *)(CPhysical*, CEntity*, CColPoint&, float&))0x5435C0)(this, entity, colPoint, arg2); + return ((bool (__thiscall *)(CPhysical*, CEntity*, CColPoint&, float&))0x5435C0)(this, entity, colPoint, outDamageIntensity); } // Converted from thiscall bool CPhysical::ApplySoftCollision(CEntity *entity,CColPoint &colPoint,float &) 0x543890 -bool CPhysical::ApplySoftCollision(CEntity* entity, CColPoint& colPoint, float& arg2) +bool CPhysical::ApplySoftCollision(CEntity* entity, CColPoint& colPoint, float& outDamageIntensity) { - return ((bool (__thiscall *)(CPhysical*, CEntity*, CColPoint&, float&))0x543890)(this, entity, colPoint, arg2); + return ((bool (__thiscall *)(CPhysical*, CEntity*, CColPoint&, float&))0x543890)(this, entity, colPoint, outDamageIntensity); } // Converted from thiscall bool CPhysical::ApplySpringCollision(float,CVector &,CVector &,float,float,float &) 0x543C90 @@ -187,10 +187,10 @@ float CPhysical::GetLightingTotal() return ((float (__thiscall *)(CPhysical*))0x544850)(this); } -// Converted from thiscall bool CPhysical::CanPhysicalBeDamaged(eWeaponType weapon,uchar *) 0x5448B0 -bool CPhysical::CanPhysicalBeDamaged(eWeaponType weapon, unsigned char* arg1) +// Converted from thiscall bool CPhysical::CanPhysicalBeDamaged(eWeaponType weapon,bool *) 0x5448B0 +bool CPhysical::CanPhysicalBeDamaged(eWeaponType weapon, bool* bDamagedDueToFireOrExplosionOrBullet) { - return ((bool (__thiscall *)(CPhysical*, eWeaponType, unsigned char*))0x5448B0)(this, weapon, arg1); + return ((bool (__thiscall *)(CPhysical*, eWeaponType, bool*))0x5448B0)(this, weapon, bDamagedDueToFireOrExplosionOrBullet); } // Converted from thiscall void CPhysical::ApplyAirResistance(void) 0x544C40 @@ -199,22 +199,22 @@ void CPhysical::ApplyAirResistance() ((void (__thiscall *)(CPhysical*))0x544C40)(this); } -// Converted from thiscall bool CPhysical::ApplyCollisionAlt(CEntity *entity,CColPoint &colPoint,float &,CVector &,CVector &) 0x544D50 -bool CPhysical::ApplyCollisionAlt(CEntity* entity, CColPoint& colPoint, float& arg2, CVector& arg3, CVector& arg4) +// Converted from thiscall bool CPhysical::ApplyCollisionAlt(CPhysical *entity,CColPoint &colPoint,float &,CVector &,CVector &) 0x544D50 +bool CPhysical::ApplyCollisionAlt(CPhysical* entity, CColPoint& colPoint, float& arg2, CVector& arg3, CVector& arg4) { - return ((bool (__thiscall *)(CPhysical*, CEntity*, CColPoint&, float&, CVector&, CVector&))0x544D50)(this, entity, colPoint, arg2, arg3, arg4); + return ((bool (__thiscall *)(CPhysical*, CPhysical*, CColPoint&, float&, CVector&, CVector&))0x544D50)(this, entity, colPoint, arg2, arg3, arg4); } // Converted from thiscall bool CPhysical::ApplyFriction(float,CColPoint &colPoint) 0x5454C0 -bool CPhysical::ApplyFriction(float arg0, CColPoint& colPoint) +bool CPhysical::ApplyFriction(float friction, CColPoint& colPoint) { - return ((bool (__thiscall *)(CPhysical*, float, CColPoint&))0x5454C0)(this, arg0, colPoint); + return ((bool (__thiscall *)(CPhysical*, float, CColPoint&))0x5454C0)(this, friction, colPoint); } // Converted from thiscall bool CPhysical::ApplyFriction(CPhysical* physical,float,CColPoint &colPoint) 0x545980 -bool CPhysical::ApplyFriction(CPhysical* physical, float arg1, CColPoint& colPoint) +bool CPhysical::ApplyFriction(CPhysical* physical, float friction, CColPoint& colPoint) { - return ((bool (__thiscall *)(CPhysical*, CPhysical*, float, CColPoint&))0x545980)(this, physical, arg1, colPoint); + return ((bool (__thiscall *)(CPhysical*, CPhysical*, float, CColPoint&))0x545980)(this, physical, friction, colPoint); } // Converted from thiscall bool CPhysical::ProcessShiftSectorList(int sectorX,int sectorY) 0x546670 diff --git a/plugin_sa/game_sa/CPhysical.h b/plugin_sa/game_sa/CPhysical.h index f69df442..b8dd1d31 100644 --- a/plugin_sa/game_sa/CPhysical.h +++ b/plugin_sa/game_sa/CPhysical.h @@ -21,41 +21,41 @@ class CPhysical : public CEntity { int field_38; unsigned int m_nLastCollisionTime; - unsigned int b01 : 1; - unsigned int bApplyGravity : 1; - unsigned int bDisableCollisionForce : 1; - unsigned int bCollidable : 1; - unsigned int bDisableTurnForce : 1; - unsigned int bDisableMoveForce : 1; - unsigned int bInfiniteMass : 1; - unsigned int bDisableZ : 1; + bool bIsHeavy : 1; // double the mass + bool bApplyGravity : 1; + bool bDisableCollisionForce : 1; + bool bCollidable : 1; + bool bDisableTurnForce : 1; + bool bDisableMoveForce : 1; + bool bInfiniteMass : 1; + bool bDisableZ : 1; - unsigned int bSubmergedInWater : 1; - unsigned int bOnSolidSurface : 1; - unsigned int bBroken : 1; - unsigned int b12 : 1; // ref @ 0x6F5CF0 - unsigned int b13 : 1; - unsigned int bDontApplySpeed : 1; - unsigned int b15 : 1; - unsigned int b16 : 1; + bool bSubmergedInWater : 1; + bool bOnSolidSurface : 1; + bool bBroken : 1; + bool bProcessCollisionEvenIfStationary : 1; + bool bSkipLineCol : 1; // only used for peds + bool bDontApplySpeed : 1; + bool b15 : 1; + bool bProcessingShift : 1; - unsigned int b17 : 1; - unsigned int b18 : 1; // ref @ CPhysical::ProcessCollision - unsigned int bBulletProof : 1; - unsigned int bFireProof : 1; - unsigned int bCollisionProof : 1; - unsigned int bMeleeProof : 1; - unsigned int bInvulnerable : 1; - unsigned int bExplosionProof : 1; + bool b17 : 1; + bool bDisableSimpleCollision : 1; + bool bBulletProof : 1; + bool bFireProof : 1; + bool bCollisionProof : 1; + bool bMeleeProof : 1; + bool bInvulnerable : 1; + bool bExplosionProof : 1; - unsigned int b25 : 1; - unsigned int bAttachedToEntity : 1; - unsigned int b27 : 1; - unsigned int bTouchingWater : 1; - unsigned int bCanBeCollidedWith : 1; - unsigned int bDestroyed : 1; - unsigned int b31 : 1; - unsigned int b32 : 1; + bool bDontCollideWithFlyers : 1; + bool bAttachedToEntity : 1; + bool bAddMovingCollisionSpeed : 1; + bool bTouchingWater : 1; + bool bCanBeCollidedWith : 1; + bool bDestroyed : 1; + bool b31 : 1; + bool b32 : 1; CVector m_vecMoveSpeed; CVector m_vecTurnSpeed; @@ -70,28 +70,28 @@ class CPhysical : public CEntity { float m_fElasticity; float m_fBuoyancyConstant; CVector m_vecCentreOfMass; - void *m_pCollisionList; - void *m_pMovingList; - char field_B8; + void* m_pCollisionList; + void* m_pMovingList; + char m_nFakePhysics; unsigned char m_nNumEntitiesCollided; unsigned char m_nContactSurface; - char field_BB; - CEntity *m_apCollidedEntities[6]; + char field_BB; // padding + CEntity* m_apCollidedEntities[6]; float m_fMovingSpeed; // ref @ CTheScripts::IsVehicleStopped float m_fDamageIntensity; - CEntity *m_pDamageEntity; + CEntity* m_pDamageEntity; CVector m_vecLastCollisionImpactVelocity; CVector m_vecLastCollisionPosn; unsigned short m_nPieceType; - short field_FA; - class CPhysical *m_pAttachedTo; + short field_FA; // padding + class CPhysical* m_pAttachedTo; CVector m_vecAttachOffset; CVector m_vecAttachedEntityPosn; CQuaternion m_qAttachedEntityRotation; - CEntity *m_pEntityIgnoredCollision; + CEntity* m_pEntityIgnoredCollision; float m_fContactSurfaceBrightness; float m_fDynamicLighting; - CRealTimeShadow *m_pShadowData; + CRealTimeShadow* m_pShadowData; // originally virtual functions void ProcessEntityCollision(CEntity *entity, CColPoint *point); @@ -101,9 +101,11 @@ class CPhysical : public CEntity { void AddToMovingList(); void RemoveFromMovingList(); void SetDamagedPieceRecord(float damageIntensity, CEntity* damagingEntity, CColPoint& colPoint, float distanceMult); + void ApplyMoveForce(CVector force); void ApplyTurnForce(CVector dir, CVector velocity); - void ApplyForce(CVector dir, CVector velocity, bool flag); + void ApplyForce(CVector dir, CVector velocity, bool bUpdateTurnSpeed); + CVector GetSpeed(CVector direction); void ApplyMoveSpeed(); void ApplyTurnSpeed(); @@ -111,28 +113,34 @@ class CPhysical : public CEntity { void ApplyFrictionMoveForce(CVector moveForce); void ApplyFrictionTurnForce(CVector posn, CVector velocity); void ApplyFrictionForce(CVector posn, CVector velocity); + void SkipPhysics(); void AddCollisionRecord(CEntity* collidedEntity); bool GetHasCollidedWith(CEntity* entity); bool GetHasCollidedWithAnyObject(); - bool ApplyCollision(CEntity* entity, CColPoint& colPoint, float& arg2); - bool ApplySoftCollision(CEntity* entity, CColPoint& colPoint, float& arg2); - bool ApplySpringCollision(float arg0, CVector& arg1, CVector& arg2, float arg3, float arg4, float& arg5); - bool ApplySpringCollisionAlt(float arg0, CVector& arg1, CVector& arg2, float arg3, float arg4, CVector& arg5, float& arg6); - bool ApplySpringDampening(float arg0, float arg1, CVector& arg2, CVector& arg3, CVector& arg4); + + bool ApplyCollision(CEntity* entity, CColPoint& colPoint, float& outDamageIntensity); + bool ApplySoftCollision(CEntity* entity, CColPoint& colPoint, float& outDamageIntensity); + bool ApplySpringCollision(float fSuspensionForceLevel, CVector& direction, CVector& collisionPoint, float fSpringLength, float fSuspensionBias, float& fSpringForceDampingLimit); + bool ApplySpringCollisionAlt(float fSuspensionForceLevel, CVector& direction, CVector& collisionPoint, float fSpringLength, float fSuspensionBias, CVector& normal, float& fSpringForceDampingLimit); + bool ApplySpringDampening(float fDampingForce, float fSpringForceDampingLimit, CVector& direction, CVector& collisionPoint, CVector& collisionPos); bool ApplySpringDampeningOld(float arg0, float arg1, CVector& arg2, CVector& arg3, CVector& arg4); + void RemoveRefsToEntity(CEntity* entity); void DettachEntityFromEntity(float x, float y, float z, bool useCollision); void DettachAutoAttachedEntity(); float GetLightingFromCol(bool flag); float GetLightingTotal(); - bool CanPhysicalBeDamaged(eWeaponType weapon, unsigned char* arg1); + bool CanPhysicalBeDamaged(eWeaponType weapon, bool* bDamagedDueToFireOrExplosionOrBullet); + void ApplyAirResistance(); - bool ApplyCollisionAlt(CEntity* entity, CColPoint& colPoint, float& arg2, CVector& arg3, CVector& arg4); - bool ApplyFriction(float arg0, CColPoint& colPoint); - bool ApplyFriction(CPhysical* physical, float arg1, CColPoint& colPoint); + bool ApplyCollisionAlt(CPhysical* entity, CColPoint& colPoint, float& damageIntensity, CVector& outVecMoveSpeed, CVector& outVecTurnSpeed); + bool ApplyFriction(float friction, CColPoint& colPoint); + bool ApplyFriction(CPhysical* physical, float friction, CColPoint& colPoint); + bool ProcessShiftSectorList(int sectorX, int sectorY); static void PlacePhysicalRelativeToOtherPhysical(CPhysical* physical1, CPhysical* physical2, CVector offset); + float ApplyScriptCollision(CVector arg0, float arg1, float arg2, CVector* arg3); void PositionAttachedEntity(); void ApplySpeed(); @@ -140,10 +148,11 @@ class CPhysical : public CEntity { void ApplyFriction(); bool ApplyCollision(CPhysical* physical, CColPoint& colPoint, float& arg2, float& arg3); bool ApplySoftCollision(CPhysical* physical, CColPoint& colPoint, float& arg2, float& arg3); + bool ProcessCollisionSectorList(int sectorX, int sectorY); bool ProcessCollisionSectorList_SimpleCar(CRepeatSector* sector); void AttachEntityToEntity(CEntity* entity, CVector offset, CVector rotation); - void AttachEntityToEntity(CEntity* entity, CVector* , RtQuat* rotation); + void AttachEntityToEntity(CEntity* entity, CVector* offset, RtQuat* rotation); bool CheckCollision(); bool CheckCollision_SimpleCar(); }; diff --git a/plugin_sa/game_sa/CRopes.cpp b/plugin_sa/game_sa/CRopes.cpp index cbb12705..e8e72657 100644 --- a/plugin_sa/game_sa/CRopes.cpp +++ b/plugin_sa/game_sa/CRopes.cpp @@ -6,47 +6,61 @@ */ #include "CRopes.h" -CRope* CRopes::ms_aRopes = (CRope*)0xB768B8; int& CRopes::ms_bPlayerControlsCrane = *(int*)0xB76898; +unsigned int& CRopes::m_nRopeIdCreationCounter = *(unsigned int*)0xB781F8; +CRope(&CRopes::ms_aRopes)[8] = *reinterpret_cast(0xB768B8); +void CRopes::Init() +{ + ((void(__cdecl *)())0x555DC0)(); +} -void CRopes::CreateRopeForSwatPed(CVector const& startPos) +void CRopes::Shutdown() { - ((void(__cdecl *)(CVector const&))0x558D10)(startPos); + ((void(__cdecl *)())0x556B10)(); } -void CRopes::FindPickupHeight(CEntity* entity) + +void CRopes::Update() { - ((void(__cdecl *)(CEntity*))0x556760)(entity); + ((void(__cdecl *)())0x558D70)(); } -int CRopes::FindRope(unsigned int id) + +void CRopes::Render() { - return ((int(__cdecl *)(unsigned int))0x556000)(id); + ((void(__cdecl *)())0x556AE0)(); } -void CRopes::Init() + +bool CRopes::RegisterRope(unsigned int ropeId, unsigned int ropeType, CVector startPos, bool expires, unsigned char segmentCount, unsigned char flags, CEntity* holder, unsigned int timeExpire) { - ((void(__cdecl *)())0x555DC0)(); + return ((bool(__cdecl *)(unsigned int, unsigned int, CVector, bool, unsigned char, unsigned char, CEntity*, unsigned int))0x556B40)(ropeId, ropeType, startPos, expires, segmentCount, flags, holder, timeExpire); } -bool CRopes::IsCarriedByRope(CEntity* entity) + +float CRopes::FindPickupHeight(CEntity* entity) { - return ((bool(__cdecl *)(CEntity*))0x555F80)(entity); + return ((float(__cdecl *)(CEntity*))0x556760)(entity); } -bool CRopes::RegisterRope(CEntity* ropeId, unsigned int ropeType, CVector startPos, bool bExpires, unsigned char segmentCount, unsigned char flags, CEntity* holder, unsigned int timeExpire) + +unsigned int CRopes::FindRope(unsigned int ropeId) { - return ((bool(__cdecl *)(CEntity*, unsigned int, CVector, bool, unsigned char, unsigned char, CEntity*, unsigned int))0x556B40)(ropeId, ropeType, startPos, bExpires, segmentCount, flags, holder, timeExpire); + return ((int(__cdecl *)(unsigned int))0x556000)(ropeId); } -void CRopes::Render() + +bool CRopes::FindCoorsAlongRope(unsigned int ropeId, float dist, CVector* outPosn, CVector* outSpeed) { - ((void(__cdecl *)())0x556AE0)(); + return ((bool(__cdecl *)(unsigned int, float, CVector*, CVector*))0x555E40)(ropeId, dist, outPosn, outSpeed); } -void CRopes::SetSpeedOfTopNode(unsigned int ropeId, CVector dirSpeed) + +unsigned int CRopes::CreateRopeForSwatPed(const CVector& startPos) { - ((void(__cdecl *)(unsigned int, CVector))0x555DF0)(ropeId, dirSpeed); + return ((unsigned int(__cdecl *)(const CVector&))0x558D10)(startPos); } -void CRopes::Shutdown() + +bool CRopes::IsCarriedByRope(CEntity* entity) { - ((void(__cdecl *)())0x556B10)(); + return ((bool(__cdecl *)(CEntity*))0x555F80)(entity); } -void CRopes::Update() + +void CRopes::SetSpeedOfTopNode(unsigned int ropeId, CVector dirSpeed) { - ((void(__cdecl *)())0x558D70)(); -} \ No newline at end of file + ((void(__cdecl *)(unsigned int, CVector))0x555DF0)(ropeId, dirSpeed); +} diff --git a/plugin_sa/game_sa/CRopes.h b/plugin_sa/game_sa/CRopes.h index f05dbfd1..ec2dbca5 100644 --- a/plugin_sa/game_sa/CRopes.h +++ b/plugin_sa/game_sa/CRopes.h @@ -8,26 +8,27 @@ #include "PluginBase.h" #include "CRope.h" - class PLUGIN_API CRopes { public: - static CRope* ms_aRopes; // array of 8 - static int& ms_bPlayerControlsCrane; + static int& ms_bPlayerControlsCrane; + + static constexpr auto MAX_NUM_ROPES = 8; + static unsigned int& m_nRopeIdCreationCounter; + static CRope (&ms_aRopes)[MAX_NUM_ROPES]; + static void Init(); + static void Shutdown(); + static void Update(); + static void Render(); - static void CreateRopeForSwatPed(CVector const& startPos); - static void FindPickupHeight(CEntity* entity); + static bool RegisterRope(unsigned int ropeId, unsigned int ropeType, CVector startPos, bool expires, unsigned char segmentCount, unsigned char flags, CEntity* holder, unsigned int timeExpire); // call in loop to make attached to holder - // Returns id to array - static int FindRope(unsigned int id); - static void Init(); - static bool IsCarriedByRope(CEntity* entity); + static float FindPickupHeight(CEntity* entity); // get model's center-to-top offset + static unsigned int FindRope(unsigned int ropeId); // returns index in the array, -1 if not found + static bool FindCoorsAlongRope(unsigned int ropeId, float dist, CVector* outPosn, CVector* outSpeed); // dist range is 0.0 to 1.0 - // Must be used in loop to make attached to holder - static bool RegisterRope(CEntity* ropeId, unsigned int ropeType, CVector startPos, bool bExpires, unsigned char segmentCount, unsigned char flags, CEntity* holder, unsigned int timeExpire); - static void Render(); - static void SetSpeedOfTopNode(unsigned int ropeId, CVector dirSpeed); - static void Shutdown(); - static void Update(); -}; \ No newline at end of file + static unsigned int CreateRopeForSwatPed(const CVector& startPos); // returns ropeId, -1 if failed + static bool IsCarriedByRope(CEntity* entity); + static void SetSpeedOfTopNode(unsigned int ropeId, CVector dirSpeed); +}; diff --git a/plugin_sa/game_sa/CVehicle.cpp b/plugin_sa/game_sa/CVehicle.cpp index 372ef7d9..833faedc 100644 --- a/plugin_sa/game_sa/CVehicle.cpp +++ b/plugin_sa/game_sa/CVehicle.cpp @@ -174,10 +174,10 @@ void CVehicle::RemoveRefsToVehicle(CEntity* entity) ((void (__thiscall *)(CVehicle*, CEntity*))(*(void ***)this)[40])(this, entity); } -// Converted from void CVehicle::BlowUpCar(CEntity *damager,uchar bHideExplosion) 0x871F24 -void CVehicle::BlowUpCar(CEntity* damager, unsigned char bHideExplosion) +// Converted from void CVehicle::BlowUpCar(CEntity *damager,bool bHideExplosion) 0x871F24 +void CVehicle::BlowUpCar(CEntity* damager, bool bHideExplosion) { - ((void (__thiscall *)(CVehicle*, CEntity*, unsigned char))(*(void ***)this)[41])(this, damager, bHideExplosion); + ((void (__thiscall *)(CVehicle*, CEntity*, bool))(*(void ***)this)[41])(this, damager, bHideExplosion); } // Converted from void CVehicle::BlowUpCarCutSceneNoExtras(bool bNoCamShake, bool bNoSpawnFlyingComps, bool bDetachWheels, bool bExplosionSound) 0x871F28 diff --git a/plugin_sa/game_sa/CVehicle.h b/plugin_sa/game_sa/CVehicle.h index 801cd7a8..51298230 100644 --- a/plugin_sa/game_sa/CVehicle.h +++ b/plugin_sa/game_sa/CVehicle.h @@ -5,21 +5,22 @@ Do not delete this comment block. Respect others' work! */ #pragma once -#include "PluginBase.h" -#include "CPhysical.h" #include "CAEVehicleAudioEntity.h" -#include "tHandlingData.h" -#include "tFlyingHandlingData.h" #include "CAutoPilot.h" -#include "eVehicleHandlingFlags.h" -#include "CStoredCollPoly.h" -#include "CVehicleModelInfo.h" -#include "tBoatHandlingData.h" +#include "CDamageManager.h" +#include "CFire.h" +#include "CPhysical.h" #include "CPtrList.h" #include "CRideAnimData.h" -#include "CDamageManager.h" +#include "CStoredCollPoly.h" +#include "CVehicleModelInfo.h" +#include "eVehicleClass.h" +#include "eVehicleHandlingFlags.h" #include "FxSystem_c.h" -#include "CFire.h" +#include "PluginBase.h" +#include "tBoatHandlingData.h" +#include "tFlyingHandlingData.h" +#include "tHandlingData.h" /* Thanks to MTA team for https://code.google.com/p/mtasa-blue/source/browse/tags/1.3.4/MTA10/game_sa/CVehicleSA.h */ @@ -31,6 +32,12 @@ enum eCarWeapon { CAR_WEAPON_DOUBLE_ROCKET }; +enum class eComedyControlState : unsigned char { + INACTIVE, + STEER_RIGHT, + STEER_LEFT +}; + enum eDoorLock : unsigned int { DOORLOCK_NOT_USED, DOORLOCK_UNLOCKED, @@ -92,142 +99,143 @@ class PLUGIN_API CVehicle : public CPhysical { protected: CVehicle(plugin::dummy_func_t) : CPhysical(plugin::dummy) {} public: - CAEVehicleAudioEntity m_vehicleAudio; - tHandlingData* m_pHandlingData; - tFlyingHandlingData* m_pFlyingHandlingData; + CAEVehicleAudioEntity m_vehicleAudio; + tHandlingData* m_pHandlingData; + tFlyingHandlingData* m_pFlyingHandlingData; + union { eVehicleHandlingFlags m_nHandlingFlagsIntValue; struct { - unsigned int b1gBoost : 1; - unsigned int b2gBoost : 1; - unsigned int bNpcAntiRoll : 1; - unsigned int bNpcNeutralHandl : 1; - unsigned int bNoHandbrake : 1; - unsigned int bSteerRearwheels : 1; - unsigned int bHbRearwheelSteer : 1; - unsigned int bAltSteerOpt : 1; - unsigned int bWheelFNarrow2 : 1; - unsigned int bWheelFNarrow : 1; - unsigned int bWheelFWide : 1; - unsigned int bWheelFWide2 : 1; - unsigned int bWheelRNarrow2 : 1; - unsigned int bWheelRNarrow : 1; - unsigned int bWheelRWide : 1; - unsigned int bWheelRWide2 : 1; - unsigned int bHydraulicGeom : 1; - unsigned int bHydraulicInst : 1; - unsigned int bHydraulicNone : 1; - unsigned int bNosInst : 1; - unsigned int bOffroadAbility : 1; - unsigned int bOffroadAbility2 : 1; - unsigned int bHalogenLights : 1; - unsigned int bProcRearwheelFirst : 1; - unsigned int bUseMaxspLimit : 1; - unsigned int bLowRider : 1; - unsigned int bStreetRacer : 1; - unsigned int bUnused1 : 1; - unsigned int bSwingingChassis : 1; + bool b1gBoost : 1; + bool b2gBoost : 1; + bool bNpcAntiRoll : 1; + bool bNpcNeutralHandl : 1; + bool bNoHandbrake : 1; + bool bSteerRearwheels : 1; + bool bHbRearwheelSteer : 1; + bool bAltSteerOpt : 1; + bool bWheelFNarrow2 : 1; + bool bWheelFNarrow : 1; + bool bWheelFWide : 1; + bool bWheelFWide2 : 1; + bool bWheelRNarrow2 : 1; + bool bWheelRNarrow : 1; + bool bWheelRWide : 1; + bool bWheelRWide2 : 1; + bool bHydraulicGeom : 1; + bool bHydraulicInst : 1; + bool bHydraulicNone : 1; + bool bNosInst : 1; + bool bOffroadAbility : 1; + bool bOffroadAbility2 : 1; + bool bHalogenLights : 1; + bool bProcRearwheelFirst : 1; + bool bUseMaxspLimit : 1; + bool bLowRider : 1; + bool bStreetRacer : 1; + bool bUnused1 : 1; + bool bSwingingChassis : 1; } m_nHandlingFlags; }; - CAutoPilot m_autoPilot; - - unsigned char bIsLawEnforcer : 1; // Is this guy chasing the player at the moment - unsigned char bIsAmbulanceOnDuty : 1; // Ambulance trying to get to an accident - unsigned char bIsFireTruckOnDuty : 1; // Firetruck trying to get to a fire - unsigned char bIsLocked : 1; // Is this guy locked by the script (cannot be removed) - unsigned char bEngineOn : 1; // For sound purposes. Parked cars have their engines switched off (so do destroyed cars) - unsigned char bIsHandbrakeOn : 1; // How's the handbrake doing ? - unsigned char bLightsOn : 1; // Are the lights switched on ? - unsigned char bFreebies : 1; // Any freebies left in this vehicle ? + + CAutoPilot m_autoPilot; + + bool bIsLawEnforcer : 1; // is this guy chasing the player at the moment + bool bIsAmbulanceOnDuty : 1; // ambulance trying to get to an accident + bool bIsFireTruckOnDuty : 1; // firetruck trying to get to a fire + bool bIsLocked : 1; // is this guy locked by the script (cannot be removed) + bool bEngineOn : 1; // for sound purposes. Parked cars have their engines switched off (so do destroyed cars) + bool bIsHandbrakeOn : 1; // how's the handbrake doing? + bool bLightsOn : 1; // are the lights switched on? + bool bFreebies : 1; // any freebies left in this vehicle? - unsigned char bIsVan : 1; // Is this vehicle a van (doors at back of vehicle) - unsigned char bIsBus : 1; // Is this vehicle a bus - unsigned char bIsBig : 1; // Is this vehicle a bus - unsigned char bLowVehicle : 1; // Need this for sporty type cars to use low getting-in/out anims - unsigned char bComedyControls : 1; // Will make the car hard to control (hopefully in a funny way) - unsigned char bWarnedPeds : 1; // Has scan and warn peds of danger been processed? - unsigned char bCraneMessageDone : 1; // A crane message has been printed for this car allready - unsigned char bTakeLessDamage : 1; // This vehicle is stronger (takes about 1/4 of damage) + bool bIsVan : 1; // is this vehicle a van (doors at back of vehicle) + bool bIsBus : 1; // is this vehicle a bus + bool bIsBig : 1; // is this vehicle a bus + bool bLowVehicle : 1; // need this for sporty type cars to use low getting-in/out anims + bool bComedyControls : 1; // will make the car hard to control (hopefully in a funny way) + bool bWarnedPeds : 1; // has scan and warn peds of danger been processed? + bool bCraneMessageDone : 1; // a crane message has been printed for this car allready + bool bTakeLessDamage : 1; // this vehicle is stronger (takes about 1/4 of damage) - unsigned char bIsDamaged : 1; // This vehicle has been damaged and is displaying all its components - unsigned char bHasBeenOwnedByPlayer : 1;// To work out whether stealing it is a crime - unsigned char bFadeOut : 1; // Fade vehicle out - unsigned char bIsBeingCarJacked : 1; // Fade vehicle out - unsigned char bCreateRoadBlockPeds : 1;// If this vehicle gets close enough we will create peds (coppers or gang members) round it - unsigned char bCanBeDamaged : 1; // Set to FALSE during cut scenes to avoid explosions - unsigned char bOccupantsHaveBeenGenerated : 1; // Is true if the occupants have already been generated. (Shouldn't happen again) - unsigned char bGunSwitchedOff : 1; // Level designers can use this to switch off guns on boats + bool bIsDamaged : 1; // this vehicle has been damaged and is displaying all its components + bool bHasBeenOwnedByPlayer : 1; // to work out whether stealing it is a crime + bool bFadeOut : 1; // fade vehicle out + bool bIsBeingCarJacked : 1; // fade vehicle out + bool bCreateRoadBlockPeds : 1; // if this vehicle gets close enough we will create peds (coppers or gang members) round it + bool bCanBeDamaged : 1; // set to FALSE during cut scenes to avoid explosions + bool bOccupantsHaveBeenGenerated : 1; // is true if the occupants have already been generated (shouldn't happen again) + bool bGunSwitchedOff : 1; // level designers can use this to switch off guns on boats - unsigned char bVehicleColProcessed : 1;// Has ProcessEntityCollision been processed for this car? - unsigned char bIsCarParkVehicle : 1; // Car has been created using the special CAR_PARK script command - unsigned char bHasAlreadyBeenRecorded : 1; // Used for replays - unsigned char bPartOfConvoy : 1; - unsigned char bHeliMinimumTilt : 1; // This heli should have almost no tilt really - unsigned char bAudioChangingGear : 1; // sounds like vehicle is changing gear - unsigned char bIsDrowning : 1; // is vehicle occupants taking damage in water (i.e. vehicle is dead in water) - unsigned char bTyresDontBurst : 1; // If this is set the tyres are invincible + bool bVehicleColProcessed : 1; // has ProcessEntityCollision been processed for this car? + bool bIsCarParkVehicle : 1; // car has been created using the special CAR_PARK script command + bool bHasAlreadyBeenRecorded : 1; // used for replays + bool bPartOfConvoy : 1; + bool bHeliMinimumTilt : 1; // this heli should have almost no tilt really + bool bAudioChangingGear : 1; // sounds like vehicle is changing gear + bool bIsDrowning : 1; // is vehicle occupants taking damage in water (i.e. vehicle is dead in water) + bool bTyresDontBurst : 1; // if this is set the tyres are invincible - unsigned char bCreatedAsPoliceVehicle : 1;// True if this guy was created as a police vehicle (enforcer, policecar, miamivice car etc) - unsigned char bRestingOnPhysical : 1; // Dont go static cause car is sitting on a physical object that might get removed - unsigned char bParking : 1; - unsigned char bCanPark : 1; - unsigned char bFireGun : 1; // Does the ai of this vehicle want to fire it's gun? - unsigned char bDriverLastFrame : 1; // Was there a driver present last frame ? - unsigned char bNeverUseSmallerRemovalRange : 1;// Some vehicles (like planes) we don't want to remove just behind the camera. - unsigned char bIsRCVehicle : 1; // Is this a remote controlled (small) vehicle. True whether the player or AI controls it. + bool bCreatedAsPoliceVehicle : 1;// true if this guy was created as a police vehicle (enforcer, policecar, miamivice car etc) + bool bRestingOnPhysical : 1; // don't go static cause car is sitting on a physical object that might get removed + bool bParking : 1; + bool bCanPark : 1; + bool bFireGun : 1; // does the AI of this vehicle want to fire it's gun? + bool bDriverLastFrame : 1; // was there a driver present last frame? + bool bNeverUseSmallerRemovalRange : 1;// some vehicles (like planes) we don't want to remove just behind the camera + bool bIsRCVehicle : 1; // is this a remote controlled (small) vehicle. True whether the player or AI controls it - unsigned char bAlwaysSkidMarks : 1; // This vehicle leaves skidmarks regardless of the wheels' states. - unsigned char bEngineBroken : 1; // Engine doesn't work. Player can get in but the vehicle won't drive - unsigned char bVehicleCanBeTargetted : 1;// The ped driving this vehicle can be targetted, (for Torenos plane mission) - unsigned char bPartOfAttackWave : 1; // This car is used in an attack during a gang war - unsigned char bWinchCanPickMeUp : 1; // This car cannot be picked up by any ropes. - unsigned char bImpounded : 1; // Has this vehicle been in a police impounding garage - unsigned char bVehicleCanBeTargettedByHS : 1;// Heat seeking missiles will not target this vehicle. - unsigned char bSirenOrAlarm : 1; // Set to TRUE if siren or alarm active, else FALSE + bool bAlwaysSkidMarks : 1; // this vehicle leaves skidmarks regardless of the wheels' states + bool bEngineBroken : 1; // engine doesn't work. Player can get in but the vehicle won't drive + bool bVehicleCanBeTargetted : 1;// the ped driving this vehicle can be targetted, (for Torenos plane mission) + bool bPartOfAttackWave : 1; // this car is used in an attack during a gang war + bool bWinchCanPickMeUp : 1; // this car cannot be picked up by any ropes + bool bImpounded : 1; // has this vehicle been in a police impounding garage + bool bVehicleCanBeTargettedByHS : 1;// heat seeking missiles will not target this vehicle + bool bSirenOrAlarm : 1; // set to TRUE if siren or alarm active, else FALSE - unsigned char bHasGangLeaningOn : 1; - unsigned char bGangMembersForRoadBlock : 1;// Will generate gang members if NumPedsForRoadBlock > 0 - unsigned char bDoesProvideCover : 1; // If this is false this particular vehicle can not be used to take cover behind. - unsigned char bMadDriver : 1; // This vehicle is driving like a lunatic - unsigned char bUpgradedStereo : 1; // This vehicle has an upgraded stereo - unsigned char bConsideredByPlayer : 1; // This vehicle is considered by the player to enter - unsigned char bPetrolTankIsWeakPoint : 1;// If false shootong the petrol tank will NOT Blow up the car - unsigned char bDisableParticles : 1; // Disable particles from this car. Used in garage. + bool bHasGangLeaningOn : 1; + bool bGangMembersForRoadBlock : 1;// will generate gang members if NumPedsForRoadBlock > 0 + bool bDoesProvideCover : 1; // if this is false this particular vehicle can not be used to take cover behind + bool bMadDriver : 1; // this vehicle is driving like a lunatic + bool bUpgradedStereo : 1; // this vehicle has an upgraded stereo + bool bConsideredByPlayer : 1; // this vehicle is considered by the player to enter + bool bPetrolTankIsWeakPoint : 1;// if false shootong the petrol tank will NOT blow up the car + bool bDisableParticles : 1; // disable particles from this car. Used in garage - unsigned char bHasBeenResprayed : 1; // Has been resprayed in a respray garage. Reset after it has been checked. - unsigned char bUseCarCheats : 1; // If this is true will set the car cheat stuff up in ProcessControl() - unsigned char bDontSetColourWhenRemapping : 1;// If the texture gets remapped we don't want to change the colour with it. - unsigned char bUsedForReplay : 1; // This car is controlled by replay and should be removed when replay is done. + bool bHasBeenResprayed : 1; // has been resprayed in a respray garage. Reset after it has been checked + bool bUseCarCheats : 1; // if this is true will set the car cheat stuff up in ProcessControl() + bool bDontSetColourWhenRemapping : 1;// if the texture gets remapped we don't want to change the colour with it + bool bUsedForReplay : 1; // this car is controlled by replay and should be removed when replay is done - unsigned int m_nCreationTime; - unsigned char m_nPrimaryColor; - unsigned char m_nSecondaryColor; - unsigned char m_nTertiaryColor; - unsigned char m_nQuaternaryColor; - char m_anExtras[2]; - short m_anUpgrades[15]; - float m_fWheelScale; + unsigned int m_nCreationTime; + unsigned char m_nPrimaryColor; + unsigned char m_nSecondaryColor; + unsigned char m_nTertiaryColor; + unsigned char m_nQuaternaryColor; + char m_anExtras[2]; + short m_anUpgrades[15]; + float m_fWheelScale; unsigned short m_nAlarmState; - short m_nForcedRandomRouteSeed; // if this is non-zero the random wander gets deterministic - CPed* m_pDriver; - CPed* m_apPassengers[8]; - unsigned char m_nNumPassengers; - unsigned char m_nNumGettingIn; - unsigned char m_nGettingInFlags; - unsigned char m_nGettingOutFlags; - unsigned char m_nMaxPassengers; - unsigned char m_nWindowsOpenFlags; // initialised, but not used? - unsigned char m_nNitroBoosts; - unsigned char m_nSpecialColModel; - CEntity* m_pEntityWeAreOn; // we get it from CWorld::ProcessVerticalLine or ProcessEntityCollision, it's entity under us, - //only static entities (buildings or roads) - CFire* m_pFire; - float m_fSteerAngle; - float m_f2ndSteerAngle; // used for steering 2nd set of wheels or elevators etc.. - float m_fGasPedal; - float m_fBreakPedal; - unsigned char m_nCreatedBy; // see eVehicleCreatedBy - short m_nExtendedRemovalRange; // when game wants to delete a vehicle, it gets min(m_wExtendedRemovalRange, 170.0) + short m_nForcedRandomRouteSeed; // if this is non-zero the random wander gets deterministic + CPed* m_pDriver; + CPed* m_apPassengers[8]; + unsigned char m_nNumPassengers; + unsigned char m_nNumGettingIn; + unsigned char m_nGettingInFlags; + unsigned char m_nGettingOutFlags; + unsigned char m_nMaxPassengers; + unsigned char m_nWindowsOpenFlags; // initialised, but not used? + unsigned char m_nNitroBoosts; + unsigned char m_nSpecialColModel; + CEntity* m_pEntityWeAreOn; // entity under us, only static entities (buildings or roads) + CFire* m_pFire; + float m_fSteerAngle; + float m_f2ndSteerAngle; // used for steering 2nd set of wheels or elevators etc.. + float m_fGasPedal; + float m_fBreakPedal; + unsigned char m_nCreatedBy; // see eVehicleCreatedBy + short m_nExtendedRemovalRange; // when game wants to delete a vehicle, it gets min(m_wExtendedRemovalRange, 170.0) unsigned char m_nBombOnBoard : 3; // 0 = None // 1 = Timed // 2 = On ignition @@ -243,63 +251,65 @@ class PLUGIN_API CVehicle : public CPhysical { unsigned char m_nPacMansCollected; // initialised, but not used? unsigned char m_nPedsPositionForRoadBlock; // 0, 1 or 2 unsigned char m_nNumCopsForRoadBlock; - float m_fDirtLevel; // Dirt level of vehicle body texture: 0.0f=fully clean, 15.0f=maximum dirt visible + float m_fDirtLevel; // Dirt level of vehicle body texture: 0.0f=fully clean, 15.0f=maximum dirt visible unsigned char m_nCurrentGear; - float m_fGearChangeCount; // used as parameter for cTransmission::CalculateDriveAcceleration, but doesn't change - float m_fWheelSpinForAudio; - float m_fHealth; // 1000.0f = full health. 0 -> explode - CVehicle* m_pTractor; - CVehicle* m_pTrailer; - CPed* m_pWhoInstalledBombOnMe; - unsigned int m_nTimeTillWeNeedThisCar; // game won't try to delete this car while this time won't reach - unsigned int m_nGunFiringTime; // last time when gun on vehicle was fired (used on boats) - unsigned int m_nTimeWhenBlowedUp; // game will delete vehicle when 60 seconds after this time will expire - short m_nCopsInCarTimer; // timer for police car (which is following player) occupants to stay in car. If this timer reachs + float m_fGearChangeCount; // used as parameter for cTransmission::CalculateDriveAcceleration, but doesn't change + float m_fWheelSpinForAudio; + float m_fHealth; // 1000.0f = full health. 0 -> explode + CVehicle* m_pTractor; + CVehicle* m_pTrailer; + CPed* m_pWhoInstalledBombOnMe; + unsigned int m_nTimeTillWeNeedThisCar; // game won't try to delete this car while this time won't reach + unsigned int m_nGunFiringTime; // last time when gun on vehicle was fired (used on boats) + unsigned int m_nTimeWhenBlowedUp; // game will delete vehicle when 60 seconds after this time will expire + short m_nCopsInCarTimer; // timer for police car (which is following player) occupants to stay in car. If this timer reachs // some value, they will leave a car. The timer increases each frame if player is stopped in car, // otherway it resets - short m_wBombTimer; // goes down with each frame - CPed* m_pWhoDetonatedMe; // if vehicle was detonated, game copies m_pWhoInstalledBombOnMe here - float m_fVehicleFrontGroundZ; // we get these values from CCollision::IsStoredPolyStillValidVerticalLine - float m_fVehicleRearGroundZ; // or CWorld::ProcessVerticalLine + short m_wBombTimer; // goes down with each frame + CPed* m_pWhoDetonatedMe; // if vehicle was detonated, game copies m_pWhoInstalledBombOnMe here + float m_fVehicleFrontGroundZ; // we get these values from CCollision::IsStoredPolyStillValidVerticalLine + float m_fVehicleRearGroundZ; // or CWorld::ProcessVerticalLine char field_4EC; // initialised, but not used? char field_4ED[11]; // possibly non-used data? - eDoorLock m_eDoorLock; - unsigned int m_nProjectileWeaponFiringTime; // manual-aimed projectiles for hunter, lock-on projectile for hydra - unsigned int m_nAdditionalProjectileWeaponFiringTime; // manual-aimed projectiles for hydra - unsigned int m_nTimeForMinigunFiring; // minigun on hunter + eDoorLock m_eDoorLock; + unsigned int m_nProjectileWeaponFiringTime; // manual-aimed projectiles for hunter, lock-on projectile for hydra + unsigned int m_nAdditionalProjectileWeaponFiringTime; // manual-aimed projectiles for hydra + unsigned int m_nTimeForMinigunFiring; // minigun on hunter unsigned char m_nLastWeaponDamageType; // see eWeaponType, -1 if no damage - CEntity* m_pLastDamageEntity; + CEntity* m_pLastDamageEntity; char field_510; // not used? char field_511; // initialised, but not used? char field_512; // initialised, but not used? - char m_nVehicleWeaponInUse; // see enum eCarWeapon - unsigned int m_nHornCounter; - char field_518; // random id related to siren - char field_519; // car horn related - char field_51A; - char m_nHasslePosId; + char m_nVehicleWeaponInUse; // see enum eCarWeapon + unsigned int m_nHornCounter; + char m_HornPattern; + char m_nCarHornTimer; // car horn related + eComedyControlState m_comedyControlState; + char m_nHasslePosId; CStoredCollPoly m_FrontCollPoly; // poly which is under front part of car CStoredCollPoly m_RearCollPoly; // poly which is under rear part of car - unsigned char m_anCollisionLighting[4]; // left front, left rear, right front, right rear - FxSystem_c* m_pOverheatParticle; - FxSystem_c* m_pFireParticle; - FxSystem_c* m_pDustParticle; + unsigned char m_anCollisionLighting[4]; // left front, left rear, right front, right rear + FxSystem_c* m_pOverheatParticle; + FxSystem_c* m_pFireParticle; + FxSystem_c* m_pDustParticle; + union { - unsigned char m_nRenderLightsFlags; + unsigned char m_nRenderLightsFlags; struct { - unsigned char m_bRightFront : 1; - unsigned char m_bLeftFront : 1; - unsigned char m_bRightRear : 1; - unsigned char m_bLeftRear : 1; + bool m_bRightFront : 1; + bool m_bLeftFront : 1; + bool m_bRightRear : 1; + bool m_bLeftRear : 1; } m_renderLights; }; - RwTexture* m_pCustomCarPlate; - CVehicle* field_58C; - unsigned int m_nVehicleClass; // see enum eVehicleClass - unsigned int m_nVehicleSubClass; - short m_nPreviousRemapTxd; - short m_nRemapTxd; - RwTexture* m_pRemapTexture; + + RwTexture* m_pCustomCarPlate; + float m_fRawSteerAngle; // AKA m_fSteeringLeftRight or fSteer + eVehicleType m_nVehicleClass; // m_nVehicleType + eVehicleType m_nVehicleSubClass; // m_nVehicleSubType + short m_nPreviousRemapTxd; + short m_nRemapTxd; + RwTexture* m_pRemapTexture; static float& WHEELSPIN_TARGET_RATE; // 1.0 static float& WHEELSPIN_INAIR_TARGET_RATE; // 10.0 @@ -342,7 +352,7 @@ class PLUGIN_API CVehicle : public CPhysical { bool IsOpenTopCar(); // remove ref to this entity void RemoveRefsToVehicle(CEntity* entity); - void BlowUpCar(CEntity* damager, unsigned char bHideExplosion); + void BlowUpCar(CEntity* damager, bool bHideExplosion); void BlowUpCarCutSceneNoExtras(bool bNoCamShake, bool bNoSpawnFlyingComps, bool bDetachWheels, bool bExplosionSound); bool SetUpWheelColModel(CColModel* wheelCol); // returns false if it's not possible to burst vehicle's tyre or it is already damaged. bPhysicalEffect=true applies random moving force to vehicle diff --git a/plugin_sa/game_sa/eEntityStatus.h b/plugin_sa/game_sa/eEntityStatus.h index 767b4670..e0e3542d 100644 --- a/plugin_sa/game_sa/eEntityStatus.h +++ b/plugin_sa/game_sa/eEntityStatus.h @@ -6,7 +6,7 @@ */ #pragma once -enum eEntityStatus +enum eEntityStatus : unsigned char { STATUS_PLAYER, STATUS_PLAYER_PLAYBACKFROMBUFFER, diff --git a/plugin_sa/game_sa/eEntityType.h b/plugin_sa/game_sa/eEntityType.h index 66e4bd93..7bea2941 100644 --- a/plugin_sa/game_sa/eEntityType.h +++ b/plugin_sa/game_sa/eEntityType.h @@ -7,7 +7,7 @@ #pragma once /* https://code.google.com/p/mtasa-blue/source/browse/trunk/MTA10/sdk/game/CEntity.h */ -enum eEntityType +enum eEntityType : unsigned char { ENTITY_TYPE_NOTHING, ENTITY_TYPE_BUILDING, diff --git a/plugin_sa/game_sa/eTaskType.h b/plugin_sa/game_sa/eTaskType.h index 2d2adfe9..bc7ffeec 100644 --- a/plugin_sa/game_sa/eTaskType.h +++ b/plugin_sa/game_sa/eTaskType.h @@ -10,12 +10,14 @@ enum eTaskType : int { - //player tasks + TASK_INVALID = -1, + + // player tasks TASK_SIMPLE_PLAYER_ON_FOOT = 0, - + TASK_SIMPLE_PLAYER_IN_CAR, - - //emergency services tasks + + // emergency services tasks TASK_COMPLEX_MEDIC_TREAT_INJURED_PED = 100, TASK_COMPLEX_TREAT_ACCIDENT, TASK_SIMPLE_GIVE_CPR, @@ -27,34 +29,26 @@ enum eTaskType : int TASK_COMPLEX_USE_SWAT_ROPE, TASK_COMPLEX_USE_WATER_CANNON, TASK_COMPLEX_EXTINGUISH_FIRE_ON_FOOT, - //SCRIPT_DECISION - - //basic tasks + + // basic tasks TASK_NONE = 200, - //SCRIPT_DECISION TASK_SIMPLE_UNINTERRUPTABLE, TASK_SIMPLE_PAUSE, - //SCRIPT_DECISION TASK_SIMPLE_STAND_STILL, - //SCRIPT_DECISION TASK_SIMPLE_SET_STAY_IN_SAME_PLACE, TASK_SIMPLE_GET_UP, TASK_COMPLEX_GET_UP_AND_STAND_STILL, TASK_SIMPLE_FALL, TASK_COMPLEX_FALL_AND_GET_UP, - //SCRIPT_DECISION TASK_COMPLEX_FALL_AND_STAY_DOWN, - //SCRIPT_DECISION TASK_SIMPLE_JUMP, TASK_COMPLEX_JUMP, - //SCRIPT_DECISION TASK_SIMPLE_DIE, TASK_SIMPLE_DROWN, TASK_SIMPLE_DIE_IN_CAR, TASK_COMPLEX_DIE_IN_CAR, TASK_SIMPLE_DROWN_IN_CAR, TASK_COMPLEX_DIE, - //SCRIPT_DECISION TASK_SIMPLE_DEAD, TASK_SIMPLE_TIRED, TASK_SIMPLE_SIT_DOWN, @@ -65,13 +59,12 @@ enum eTaskType : int TASK_COMPLEX_OBSERVE_TRAFFIC_LIGHTS_AND_ACHIEVE_HEADING, TASK_NOT_USED, TASK_COMPLEX_CROSS_ROAD_LOOK_AND_ACHIEVE_HEADING, - TASK_SIMPLE_TURN_180, + TASK_SIMPLE_TURN_180, TASK_SIMPLE_HAIL_TAXI, TASK_COMPLEX_HIT_RESPONSE, TASK_COMPLEX_HIT_BY_GUN_RESPONSE, TASK_UNUSED_SLOT, TASK_COMPLEX_USE_EFFECT, - //SCRIPT_DECISION TASK_COMPLEX_WAIT_AT_ATTRACTOR, TASK_COMPLEX_USE_ATTRACTOR, TASK_COMPLEX_WAIT_FOR_DRY_WEATHER, @@ -83,16 +76,14 @@ enum eTaskType : int TASK_SIMPLE_LAND, TASK_COMPLEX_BE_IN_GROUP, TASK_COMPLEX_SEQUENCE, - //SCRIPT_DECISION TASK_SIMPLE_CALL_FOR_BACKUP, - + TASK_COMPLEX_USE_PAIRED_ATTRACTOR, TASK_COMPLEX_USE_ATTRACTOR_PARTNER, TASK_COMPLEX_ATTRACTOR_PARTNER_WAIT, - TASK_COMPLEX_USE_SCRIPTED_ATTRACTOR, - TASK_COMPLEX_ON_FIRE, + TASK_COMPLEX_USE_SCRIPTED_ATTRACTOR, + TASK_COMPLEX_ON_FIRE, TASK_SIMPLE_BE_DAMAGED, - //SCRIPT_DECISION TASK_SIMPLE_TRIGGER_EVENT, TASK_SIMPLE_RAGDOLL, TASK_SIMPLE_CLIMB, @@ -100,15 +91,10 @@ enum eTaskType : int TASK_COMPLEX_PARTNER, TASK_COMPLEX_STARE_AT_PED, TASK_COMPLEX_USE_CLOSEST_FREE_SCRIPTED_ATTRACTOR, - //SCRIPT_DECISION TASK_COMPLEX_USE_EFFECT_RUNNING, - //SCRIPT_DECISION TASK_COMPLEX_USE_EFFECT_SPRINTING, - //SCRIPT_DECISION TASK_COMPLEX_USE_CLOSEST_FREE_SCRIPTED_ATTRACTOR_RUN, - //SCRIPT_DECISION TASK_COMPLEX_USE_CLOSEST_FREE_SCRIPTED_ATTRACTOR_SPRINT, - //SCRIPT_DECISION TASK_SIMPLE_CHOKING, TASK_SIMPLE_IK_CHAIN, TASK_SIMPLE_IK_MANAGER, @@ -116,7 +102,6 @@ enum eTaskType : int TASK_COMPLEX_CLIMB, TASK_COMPLEX_IN_WATER, TASK_SIMPLE_TRIGGER_LOOK_AT, - //SCRIPT_DECISION TASK_SIMPLE_CLEAR_LOOK_AT, TASK_SIMPLE_SET_CHAR_DECISION_MAKER, TASK_SIMPLE_IK_POINT_R_ARM, @@ -126,27 +111,22 @@ enum eTaskType : int TASK_SIMPLE_SET_KINDA_STAY_IN_SAME_PLACE, TASK_COMPLEX_FALL_TO_DEATH, TASK_WAIT_FOR_MATCHING_LEADER_AREA_CODES, - - //secondary tasks + + // secondary tasks TASK_SIMPLE_LOOK_AT_ENTITY_OR_COORD = 300, - //SCRIPT_DECISION TASK_SIMPLE_SAY, - //SCRIPT_DECISION TASK_SIMPLE_SHAKE_FIST, - //SCRIPT_DECISION TASK_SIMPLE_FACIAL, - //SCRIPT_DECISION TASK_COMPLEX_CHAINED_FACIAL, TASK_COMPLEX_FACIAL, TASK_SIMPLE_AFFECT_SECONDARY_BEHAVIOUR, TASK_SIMPLE_HOLD_ENTITY, - TASK_SIMPLE_PICKUP_ENTITY, // these three aren't really secondary tasks - TASK_SIMPLE_PUTDOWN_ENTITY, // but they exist around the secondary hold entity + TASK_SIMPLE_PICKUP_ENTITY, // these three aren't really secondary tasks + TASK_SIMPLE_PUTDOWN_ENTITY, // but they exist around the secondary hold entity TASK_COMPLEX_GO_PICKUP_ENTITY, // task at the start and finish TASK_SIMPLE_DUCK_WHILE_SHOTS_WHIZZING, - //SCRIPT_DECISION - - //anims (tasks that are sub-classes of CTaskSimpleRunUnloopedAnim) + + // anims (tasks that are sub-classes of CTaskSimpleRunUnloopedAnim) TASK_SIMPLE_ANIM = 400, TASK_SIMPLE_NAMED_ANIM, TASK_SIMPLE_TIMED_ANIM, @@ -154,18 +134,15 @@ enum eTaskType : int TASK_SIMPLE_HIT_FRONT, TASK_SIMPLE_HIT_LEFT, TASK_SIMPLE_HIT_RIGHT, - TASK_SIMPLE_HIT_BY_GUN_BACK, + TASK_SIMPLE_HIT_BY_GUN_BACK, // AKA TASK_SIMPLE_HIT_BY_GUN_REAR TASK_SIMPLE_HIT_BY_GUN_FRONT, TASK_SIMPLE_HIT_BY_GUN_LEFT, TASK_SIMPLE_HIT_BY_GUN_RIGHT, TASK_SIMPLE_HIT_WALL, TASK_SIMPLE_COWER, - //SCRIPT_DECISION TASK_SIMPLE_HANDS_UP, - //SCRIPT_DECISION TASK_SIMPLE_HIT_BEHIND, TASK_SIMPLE_DUCK, - //SCRIPT_DECISION TASK_SIMPLE_CHAT, TASK_COMPLEX_SUNBATHE, TASK_SIMPLE_SUNBATHE, @@ -178,12 +155,11 @@ enum eTaskType : int TASK_SIMPLE_HANDSIGNAL_ANIM, TASK_COMPLEX_HANDSIGNAL_ANIM, TASK_SIMPLE_DUCK_FOREVER, - //SCRIPT_DECISION TASK_SIMPLE_START_SUNBATHING, TASK_SIMPLE_IDLE_SUNBATHING, TASK_SIMPLE_STOP_SUNBATHING, - - //collision response tasks + + // collision response tasks TASK_SIMPLE_HIT_HEAD = 500, TASK_SIMPLE_EVASIVE_STEP, TASK_COMPLEX_EVASIVE_STEP, @@ -193,93 +169,68 @@ enum eTaskType : int TASK_SIMPLE_KILL_PED_WITH_CAR, TASK_SIMPLE_HURT_PED_WITH_CAR, TASK_COMPLEX_WALK_ROUND_CAR, - //SCRIPT_DECISION TASK_COMPLEX_WALK_ROUND_BUILDING_ATTEMPT, TASK_COMPLEX_WALK_ROUND_OBJECT, - //SCRIPT_DECISION TASK_COMPLEX_MOVE_BACK_AND_JUMP, TASK_COMPLEX_EVASIVE_COWER, TASK_COMPLEX_DIVE_FROM_ATTACHED_ENTITY_AND_GET_UP, - //SCRIPT_DECISION TASK_COMPLEX_WALK_ROUND_FIRE, - //SCRIPT_DECISION TASK_COMPLEX_STUCK_IN_AIR, - - //threat response tasks - TASK_COMPLEX_INVESTIGATE_DEAD_PED = 600, - //SCRIPT_DECISION + + // threat response tasks + TASK_COMPLEX_INVESTIGATE_DEAD_PED = 600, TASK_COMPLEX_REACT_TO_GUN_AIMED_AT, - //SCRIPT_DECISION - TASK_COMPLEX_WAIT_FOR_BACKUP, + TASK_COMPLEX_WAIT_FOR_BACKUP, TASK_COMPLEX_GET_OUT_OF_WAY_OF_CAR, - //SCRIPT_DECISION TASK_COMPLEX_EXTINGUISH_FIRES, - //SCRIPT_DECISION - - //car tasks - - //public car tasks + + // car tasks + + // public car tasks TASK_COMPLEX_ENTER_CAR_AS_PASSENGER = 700, - //SCRIPT_DECISION TASK_COMPLEX_ENTER_CAR_AS_DRIVER, - //SCRIPT_DECISION TASK_COMPLEX_STEAL_CAR, - //SCRIPT_DECISION TASK_COMPLEX_DRAG_PED_FROM_CAR, - //SCRIPT_DECISION TASK_COMPLEX_LEAVE_CAR, - //SCRIPT_DECISION TASK_COMPLEX_LEAVE_CAR_AND_DIE, - //SCRIPT_DECISION TASK_COMPLEX_LEAVE_CAR_AND_FLEE, - //SCRIPT_DECISION TASK_COMPLEX_LEAVE_CAR_AND_WANDER, - //SCRIPT_DECISION TASK_COMPLEX_SCREAM_IN_CAR_THEN_LEAVE, - //SCRIPT_DECISION TASK_SIMPLE_CAR_DRIVE, - //SCRIPT_DECISION TASK_COMPLEX_CAR_DRIVE_TO_POINT, - //SCRIPT_DECISION TASK_COMPLEX_CAR_DRIVE_WANDER, - //SCRIPT_DECISION TASK_COMPLEX_ENTER_CAR_AS_PASSENGER_TIMED, - //SCRIPT_DECISION TASK_COMPLEX_ENTER_CAR_AS_DRIVER_TIMED, - //SCRIPT_DECISION TASK_COMPLEX_LEAVE_ANY_CAR, - //SCRIPT_DECISION TASK_COMPLEX_ENTER_BOAT_AS_DRIVER, - + TASK_COMPLEX_LEAVE_BOAT, TASK_COMPLEX_ENTER_ANY_CAR_AS_DRIVER, TASK_COMPLEX_ENTER_CAR_AS_PASSENGER_WAIT, TASK_SIMPLE_CAR_DRIVE_TIMED, TASK_COMPLEX_SHUFFLE_SEATS, - + TASK_COMPLEX_CAR_DRIVE_POINT_ROUTE, TASK_COMPLEX_CAR_OPEN_DRIVER_DOOR, TASK_SIMPLE_CAR_SET_TEMP_ACTION, TASK_COMPLEX_CAR_DRIVE_MISSION, TASK_COMPLEX_CAR_DRIVE, TASK_COMPLEX_CAR_DRIVE_MISSION_FLEE_SCENE, - //SCRIPT_DECISION TASK_COMPLEX_ENTER_LEADER_CAR_AS_PASSENGER, TASK_COMPLEX_CAR_OPEN_PASSENGER_DOOR, TASK_COMPLEX_CAR_DRIVE_MISSION_KILL_PED, - //SCRIPT_DECISION TASK_COMPLEX_LEAVE_CAR_AS_PASSENGER_WAIT, - - //private car tasks (used only by public car tasks) + + // private car tasks (used only by public car tasks) TASK_COMPLEX_GO_TO_CAR_DOOR_AND_STAND_STILL = 800, - TASK_SIMPLE_CAR_ALIGN, + TASK_SIMPLE_CAR_ALIGN, TASK_SIMPLE_CAR_OPEN_DOOR_FROM_OUTSIDE, TASK_SIMPLE_CAR_OPEN_LOCKED_DOOR_FROM_OUTSIDE, TASK_SIMPLE_BIKE_PICK_UP, TASK_SIMPLE_CAR_CLOSE_DOOR_FROM_INSIDE, TASK_SIMPLE_CAR_CLOSE_DOOR_FROM_OUTSIDE, TASK_SIMPLE_CAR_GET_IN, - + TASK_SIMPLE_CAR_SHUFFLE, TASK_SIMPLE_CAR_WAIT_TO_SLOW_DOWN, TASK_SIMPLE_CAR_WAIT_FOR_DOOR_NOT_TO_BE_IN_USE, @@ -289,7 +240,7 @@ enum eTaskType : int TASK_SIMPLE_CAR_JUMP_OUT, TASK_SIMPLE_CAR_FORCE_PED_OUT, TASK_SIMPLE_CAR_SET_PED_OUT, - + TASK_SIMPLE_CAR_QUICK_DRAG_PED_OUT, TASK_SIMPLE_CAR_QUICK_BE_DRAGGED_OUT, TASK_SIMPLE_CAR_SET_PED_QUICK_DRAGGED_OUT, @@ -308,10 +259,9 @@ enum eTaskType : int TASK_SIMPLE_CREATE_CAR_AND_GET_IN, TASK_SIMPLE_WAIT_UNTIL_PED_IN_CAR, TASK_SIMPLE_CAR_FALL_OUT, - - //goto tasks + + // goto tasks TASK_SIMPLE_GO_TO_POINT = 900, - //SCRIPT_DECISION TASK_COMPLEX_GO_TO_POINT_SHOOTING, TASK_SIMPLE_ACHIEVE_HEADING, TASK_COMPLEX_GO_TO_POINT_AND_STAND_STILL, @@ -319,27 +269,19 @@ enum eTaskType : int TASK_COMPLEX_FOLLOW_POINT_ROUTE, TASK_COMPLEX_FOLLOW_NODE_ROUTE, TASK_COMPLEX_SEEK_ENTITY, - //SCRIPT_DECISION TASK_COMPLEX_FLEE_POINT, - //SCRIPT_DECISION TASK_COMPLEX_FLEE_ENTITY, - //SCRIPT_DECISION TASK_COMPLEX_SMART_FLEE_POINT, - //SCRIPT_DECISION TASK_COMPLEX_SMART_FLEE_ENTITY, - //SCRIPT_DECISION TASK_COMPLEX_WANDER, TASK_COMPLEX_FOLLOW_LEADER_IN_FORMATION, TASK_COMPLEX_FOLLOW_SEXY_PED, - //SCRIPT_DECISION TASK_COMPLEX_GO_TO_ATTRACTOR, TASK_COMPLEX_LEAVE_ATTRACTOR, TASK_COMPLEX_AVOID_OTHER_PED_WHILE_WANDERING, - //SCRIPT_DECISION TASK_COMPLEX_GO_TO_POINT_ANY_MEANS, TASK_COMPLEX_WALK_ROUND_SHOP, TASK_COMPLEX_TURN_TO_FACE_ENTITY, - //SCRIPT_DECISION TASK_COMPLEX_AVOID_BUILDING, TASK_COMPLEX_SEEK_ENTITY_ANY_MEANS, TASK_COMPLEX_FOLLOW_LEADER_ANY_MEANS, @@ -347,48 +289,42 @@ enum eTaskType : int TASK_COMPLEX_TRACK_ENTITY, TASK_SIMPLE_GO_TO_POINT_FINE, TASK_COMPLEX_FLEE_ANY_MEANS, - //SCRIPT_DECISION TASK_COMPLEX_FLEE_SHOOTING, TASK_COMPLEX_SEEK_ENTITY_SHOOTING, TASK_UNUSED1, TASK_COMPLEX_FOLLOW_PATROL_ROUTE, TASK_COMPLEX_GOTO_DOOR_AND_OPEN, TASK_COMPLEX_SEEK_ENTITY_AIMING, - //SCRIPT_DECISION TASK_SIMPLE_SLIDE_TO_COORD, TASK_COMPLEX_INVESTIGATE_DISTURBANCE, - //SCRIPT_DECISION TASK_COMPLEX_FOLLOW_PED_FOOTSTEPS, TASK_COMPLEX_FOLLOW_NODE_ROUTE_SHOOTING, TASK_COMPLEX_USE_ENTRYEXIT, TASK_COMPLEX_AVOID_ENTITY, TASK_SMART_FLEE_ENTITY_WALKING, - - //fight tasks - + + // fight tasks TASK_COMPLEX_KILL_PED_ON_FOOT = 1000, - //SCRIPT_DECISION TASK_COMPLEX_KILL_PED_ON_FOOT_MELEE, TASK_COMPLEX_KILL_PED_ON_FOOT_ARMED, TASK_COMPLEX_DESTROY_CAR, - //SCRIPT_DECISION TASK_COMPLEX_DESTROY_CAR_MELEE, TASK_COMPLEX_DESTROY_CAR_ARMED, - //TASK_COMPLEX_FIGHT, - //TASK_SIMPLE_FIRE_RANGED, - //TASK_SIMPLE_FIRE_RANGED_CROUCHED, - //TASK_SIMPLE_FIRE_RELOAD, - //TASK_SIMPLE_FIRE_SNIPER, - - //TASK_COMPLEX_ATTACK_RANGED, - //TASK_SIMPLE_AIM_GUN, - //TASK_SIMPLE_FIGHT_IDLE, - //TASK_SIMPLE_FIGHT_SHUFFLE, - //TASK_SIMPLE_ATTACK_MELEE, - //TASK_SIMPLE_FIRE_PROJECTILE, - //TASK_SIMPLE_ATTACK_UNARMED, - //TASK_COMPLEX_THROW_PROJECTILE, - //TASK_SIMPLE_THROW_WEAPON, + // TASK_COMPLEX_FIGHT, + // TASK_SIMPLE_FIRE_RANGED, + // TASK_SIMPLE_FIRE_RANGED_CROUCHED, + // TASK_SIMPLE_FIRE_RELOAD, + // TASK_SIMPLE_FIRE_SNIPER, + + // TASK_COMPLEX_ATTACK_RANGED, + // TASK_SIMPLE_AIM_GUN, + // TASK_SIMPLE_FIGHT_IDLE, + // TASK_SIMPLE_FIGHT_SHUFFLE, + // TASK_SIMPLE_ATTACK_MELEE, + // TASK_SIMPLE_FIRE_PROJECTILE, + // TASK_SIMPLE_ATTACK_UNARMED, + // TASK_COMPLEX_THROW_PROJECTILE, + // TASK_SIMPLE_THROW_WEAPON, TASK_COMPLEX_REACT_TO_ATTACK, TASK_SIMPLE_BE_KICKED_ON_GROUND, TASK_SIMPLE_BE_HIT, @@ -399,84 +335,65 @@ enum eTaskType : int TASK_COMPLEX_DO_DRIVEBY, TASK_KILL_ALL_THREATS, TASK_KILL_PED_GROUP_ON_FOOT, - + // new weapon/fight tasks TASK_SIMPLE_FIGHT, TASK_SIMPLE_USE_GUN, TASK_SIMPLE_THROW, TASK_SIMPLE_FIGHT_CTRL, TASK_SIMPLE_GUN_CTRL, - //SCRIPT_DECISION TASK_SIMPLE_THROW_CTRL, TASK_SIMPLE_GANG_DRIVEBY, - //SCRIPT_DECISION - - TASK_COMPLEX_KILL_PED_ON_FOOT_TIMED, //SCRIPT_DECISION - TASK_COMPLEX_KILL_PED_ON_FOOT_STAND_STILL, //SCRIPT_DECISION + + TASK_COMPLEX_KILL_PED_ON_FOOT_TIMED, // SCRIPT_DECISION + TASK_COMPLEX_KILL_PED_ON_FOOT_STAND_STILL, // SCRIPT_DECISION TASK_UNUSED2, TASK_KILL_PED_ON_FOOT_WHILE_DUCKING, - //SCRIPT_DECISION TASK_SIMPLE_STEALTH_KILL, TASK_COMPLEX_KILL_PED_ON_FOOT_STEALTH, - //SCRIPT_DECISION TASK_COMPLEX_KILL_PED_ON_FOOT_KINDA_STAND_STILL, - //SCRIPT_DECISION TASK_COMPLEX_KILL_PED_AND_REENTER_CAR, TASK_COMPLEX_ROAD_RAGE, - //SCRIPT_DECISION TASK_KILL_PED_FROM_BOAT, TASK_SIMPLE_SET_CHAR_IGNORE_WEAPON_RANGE_FLAG, - + TASK_SEEK_COVER_UNTIL_TARGET_DEAD, - - //police tasks - + + // police tasks TASK_SIMPLE_ARREST_PED = 1100, - + TASK_COMPLEX_ARREST_PED, - //SCRIPT_DECISION TASK_SIMPLE_BE_ARRESTED, TASK_COMPLEX_POLICE_PURSUIT, TASK_COMPLEX_BE_COP, TASK_COMPLEX_KILL_CRIMINAL, - //SCRIPT_DECISION TASK_COMPLEX_COP_IN_CAR, - - //gang/partner tasks - + + // gang/partner tasks TASK_SIMPLE_INFORM_GROUP = 1200, - //SCRIPT_DECISION TASK_COMPLEX_GANG_LEADER, TASK_COMPLEX_PARTNER_DEAL, - //SCRIPT_DECISION TASK_COMPLEX_PARTNER_GREET, - //SCRIPT_DECISION TASK_COMPLEX_PARTNER_CHAT, TASK_COMPLEX_GANG_HASSLE_VEHICLE, - //SCRIPT_DECISION TASK_COMPLEX_WALK_WITH_PED, TASK_COMPLEX_GANG_FOLLOWER, TASK_COMPLEX_WALK_ALONGSIDE_PED, TASK_COMPLEX_PARTNER_SHOVE, - //SCRIPT_DECISION TASK_COMPLEX_SIGNAL_AT_PED, - //SCRIPT_DECISION TASK_COMPLEX_PASS_OBJECT, TASK_COMPLEX_GANG_HASSLE_PED, - //SCRIPT_DECISION TASK_COMPLEX_WAIT_FOR_PED, TASK_SIMPLE_DO_HAND_SIGNAL, //TASK_COMPLEX_THROW_OBJECT_BEING_HELD, TASK_COMPLEX_BE_IN_COUPLE, TASK_COMPLEX_GOTO_VEHICLE_AND_LEAN, TASK_COMPLEX_LEAN_ON_VEHICLE, - //SCRIPT_DECISION TASK_COMPLEX_CHAT, TASK_COMPLEX_GANG_JOIN_RESPOND, - - //misc + + // misc TASK_ZONE_RESPONSE = 1300, - //SCRIPT_DECISION TASK_SIMPLE_TOGGLE_PED_THREAT_SCANNER, TASK_FINISHED, TASK_SIMPLE_JETPACK, @@ -486,7 +403,7 @@ enum eTaskType : int TASK_WAIT_FOR_MATCHING_AREA_CODES, TASK_SIMPLE_ON_ESCALATOR, TASK_COMPLEX_PROSTITUTE_SOLICIT, - + // interior tasks TASK_INTERIOR_USE_INFO = 1400, TASK_INTERIOR_GOTO_INFO, @@ -506,45 +423,27 @@ enum eTaskType : int TASK_INTERIOR_RESERVED6, TASK_INTERIOR_RESERVED7, TASK_INTERIOR_RESERVED8, - + // group tasks TASK_GROUP_FOLLOW_LEADER_ANY_MEANS = 1500, - //SCRIPT_DECISION TASK_GROUP_FOLLOW_LEADER_WITH_LIMITS, - //SCRIPT_DECISION TASK_GROUP_KILL_THREATS_BASIC, - //SCRIPT_DECISION TASK_GROUP_KILL_PLAYER_BASIC, - //SCRIPT_DECISION TASK_GROUP_STARE_AT_PED, - //SCRIPT_DECISION TASK_GROUP_FLEE_THREAT, - //SCRIPT_DECISION TASK_GROUP_PARTNER_DEAL, - //SCRIPT_DECISION TASK_GROUP_PARTNER_GREET, - //SCRIPT_DECISION TASK_GROUP_HASSLE_SEXY_PED, - //SCRIPT_DECISION TASK_GROUP_HASSLE_THREAT, - //SCRIPT_DECISION TASK_GROUP_USE_MEMBER_DECISION, - //SCRIPT_DECISION TASK_GROUP_EXIT_CAR, - //SCRIPT_DECISION TASK_GROUP_ENTER_CAR, - //SCRIPT_DECISION TASK_GROUP_ENTER_CAR_AND_PERFORM_SEQUENCE, - //SCRIPT_DECISION TASK_GROUP_RESPOND_TO_LEADER_COMMAND, - //SCRIPT_DECISION TASK_GROUP_HAND_SIGNAL, - //SCRIPT_DECISION TASK_GROUP_DRIVEBY, - //SCRIPT_DECISION TASK_GROUP_HASSLE_THREAT_PASSIVE, - //SCRIPT_DECISION - + // phone / goggles tasks TASK_COMPLEX_USE_MOBILE_PHONE = 1600, TASK_SIMPLE_PHONE_TALK, @@ -553,22 +452,13 @@ enum eTaskType : int TASK_COMPLEX_USE_GOGGLES, TASK_SIMPLE_GOGGLES_ON, TASK_SIMPLE_GOGGLES_OFF, - + // inform friends TASK_SIMPLE_INFORM_RESPECTED_FRIENDS = 1700, - //SCRIPT_DECISION - + // brain tasks TASK_COMPLEX_USE_SCRIPTED_BRAIN = 1800, TASK_SIMPLE_FINISH_BRAIN, - /* - // test tasks - TASK_COMPLEX_A, - TASK_COMPLEX_B, - TASK_COMPLEX_C, - TASK_COMPLEX_D, - TASK_COMPLEX_E, - */ MAX_NUM_TASK_TYPES -}; \ No newline at end of file +};