diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-31 19:59:01 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-31 19:59:01 +0200 |
commit | c1c163d78c7f822b62aa6b0f5c7b00642b961700 (patch) | |
tree | 7a586e9878b6725e52f92e0efbc6576828b18696 /src/peds | |
parent | better name (diff) | |
download | re3-c1c163d78c7f822b62aa6b0f5c7b00642b961700.tar re3-c1c163d78c7f822b62aa6b0f5c7b00642b961700.tar.gz re3-c1c163d78c7f822b62aa6b0f5c7b00642b961700.tar.bz2 re3-c1c163d78c7f822b62aa6b0f5c7b00642b961700.tar.lz re3-c1c163d78c7f822b62aa6b0f5c7b00642b961700.tar.xz re3-c1c163d78c7f822b62aa6b0f5c7b00642b961700.tar.zst re3-c1c163d78c7f822b62aa6b0f5c7b00642b961700.zip |
Diffstat (limited to '')
-rw-r--r-- | src/peds/Ped.cpp | 36 | ||||
-rw-r--r-- | src/peds/Ped.h | 2 |
2 files changed, 38 insertions, 0 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp index 687f9da1..406ac23f 100644 --- a/src/peds/Ped.cpp +++ b/src/peds/Ped.cpp @@ -60,6 +60,7 @@ #include "Streaming.h" #include "PedAttractor.h" #include "Debug.h" +#include "GameLogic.h" #define CAN_SEE_ENTITY_ANGLE_THRESHOLD DEGTORAD(60.0f) @@ -16228,6 +16229,12 @@ CPed::SetExitCar(CVehicle *veh, uint32 wantedDoorNode) return; } if (!someoneExitsFromOurExitDoor || m_nPedType == PEDTYPE_COP && veh->bIsBus) { +#if defined GTAVC_JP_PATCH || defined FIX_BUGS + if (veh->pDriver == this && !IsPlayer() && veh == CGameLogic::pShortCutTaxi) { + m_objective = OBJECTIVE_NONE; + return; + } +#endif // Again, unused... // CVector exitPos = GetPositionToOpenCarDoor(veh, optedDoorNode); bool thereIsRoom = veh->IsRoomForPedToLeaveCar(optedDoorNode, nil); @@ -18666,6 +18673,35 @@ CPed::CanBeDamagedByThisGangMember(CPed* who) return m_gangFlags & (1 << (uint8)(who->m_nPedType - PEDTYPE_GANG1)); } +void +CPed::Undress(const char* name) +{ + int mi = GetModelIndex(); + CAnimBlendAssociation* pAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_PHONE_OUT); + //if (pAnim) + // FinishTalkingOnMobileCB(pAnim, this); // TODO(MIAMI) + DeleteRwObject(); + if (m_nPedType == PEDTYPE_PLAYER1) + mi = MI_PLAYER; + CStreaming::RequestSpecialModel(mi, name, STREAMFLAGS_DEPENDENCY | STREAMFLAGS_SCRIPTOWNED); + CWorld::Remove(this); +} + +void +CPed::Dress(void) +{ + int mi = GetModelIndex(); + m_modelIndex = -1; + SetModelIndex(mi); + m_nPedState = PED_IDLE; + m_nLastPedState = PED_NONE; + m_objective = OBJECTIVE_NONE; + m_prevObjective = OBJECTIVE_NONE; + m_nWaitState = WAITSTATE_FALSE; + CWorld::Add(this); + m_headingRate = m_pedStats->m_headingChangeRate; +} + bool IsPedPointerValid_NotInWorld(CPed* pPed) { diff --git a/src/peds/Ped.h b/src/peds/Ped.h index 155e6cea..bbc5334b 100644 --- a/src/peds/Ped.h +++ b/src/peds/Ped.h @@ -916,6 +916,8 @@ public: void SetNewAttraction(CPedAttractor* pAttractor, const CVector& pos, float, float, int); void ClearWaitState(void); + void Undress(const char*); + void Dress(void); bool HasWeaponSlot(uint8 slot) { return m_weapons[slot].m_eWeaponType != WEAPONTYPE_UNARMED; } CWeapon& GetWeapon(uint8 slot) { return m_weapons[slot]; } |