diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2019-11-09 14:44:36 +0100 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2019-11-09 14:44:36 +0100 |
commit | 5ef291ddf27aed2c27b39c3c30a9d5d27f7548b9 (patch) | |
tree | 710f5904ec705a30d64a568ce5f3ede0e2d91690 /src/control/Script.cpp | |
parent | script stubs (diff) | |
parent | Fix link to config.h in readme (diff) | |
download | re3-5ef291ddf27aed2c27b39c3c30a9d5d27f7548b9.tar re3-5ef291ddf27aed2c27b39c3c30a9d5d27f7548b9.tar.gz re3-5ef291ddf27aed2c27b39c3c30a9d5d27f7548b9.tar.bz2 re3-5ef291ddf27aed2c27b39c3c30a9d5d27f7548b9.tar.lz re3-5ef291ddf27aed2c27b39c3c30a9d5d27f7548b9.tar.xz re3-5ef291ddf27aed2c27b39c3c30a9d5d27f7548b9.tar.zst re3-5ef291ddf27aed2c27b39c3c30a9d5d27f7548b9.zip |
Diffstat (limited to 'src/control/Script.cpp')
-rw-r--r-- | src/control/Script.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/control/Script.cpp b/src/control/Script.cpp index ccb551dd..d361045c 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -4677,7 +4677,7 @@ int8 CRunningScript::ProcessCommandsFrom500To599(int32 command) CollectParameters(&m_nIp, 2); CPlayerPed* pPed = CWorld::Players[ScriptParams[0]].m_pPed; assert(pPed); - pPed->m_fHealth = *(float*)&ScriptParams[1]; + pPed->m_fHealth = ScriptParams[1]; return 0; } case COMMAND_SET_CHAR_HEALTH: @@ -4685,9 +4685,8 @@ int8 CRunningScript::ProcessCommandsFrom500To599(int32 command) CollectParameters(&m_nIp, 2); CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]); assert(pPed); - float health = *(float*)&ScriptParams[1]; - if (health != 0.0f) { - pPed->m_fHealth = *(float*)&ScriptParams[1]; + if (ScriptParams[1]) { + pPed->m_fHealth = ScriptParams[1]; } else if (pPed->bInVehicle) { pPed->SetDead(); @@ -4704,7 +4703,7 @@ int8 CRunningScript::ProcessCommandsFrom500To599(int32 command) CollectParameters(&m_nIp, 2); CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]); assert(pVehicle); - pVehicle->m_fHealth = *(float*)&ScriptParams[1]; + pVehicle->m_fHealth = ScriptParams[1]; return 0; } case COMMAND_GET_PLAYER_HEALTH: @@ -4840,7 +4839,7 @@ int8 CRunningScript::ProcessCommandsFrom500To599(int32 command) CPed* pSourcePed = CPools::GetPedPool()->GetAt(ScriptParams[0]); assert(pSourcePed); pSourcePed->ClearLookFlag(); - pSourcePed->bIsRestoringLook = false; + pSourcePed->bKeepTryingToLook = false; if (pSourcePed->GetPedState() == PED_LOOK_HEADING || pSourcePed->GetPedState() == PED_LOOK_ENTITY) pSourcePed->RestorePreviousState(); return 0; @@ -4851,7 +4850,7 @@ int8 CRunningScript::ProcessCommandsFrom500To599(int32 command) CPed* pSourcePed = CWorld::Players[ScriptParams[0]].m_pPed; assert(pSourcePed); pSourcePed->ClearLookFlag(); - pSourcePed->bIsRestoringLook = false; + pSourcePed->bKeepTryingToLook = false; if (pSourcePed->GetPedState() == PED_LOOK_HEADING || pSourcePed->GetPedState() == PED_LOOK_ENTITY) pSourcePed->RestorePreviousState(); return 0; |