Skip to content

Commit

Permalink
v1.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
JuniorDjjr authored Jan 16, 2021
1 parent 4b7cda8 commit fd113b1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions CLEOPlus/CLEOPlus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "rw/rpworld.h"
#include <set>

constexpr uint32_t CLEOPLUS_VERSION_INT = 0x01000600;
constexpr uint32_t CLEOPLUS_VERSION_INT = 0x01000700;

using namespace plugin;
using namespace std;
Expand Down Expand Up @@ -960,7 +960,7 @@ class CLEOPlus
{
VehExtended &xdata = vehExtData.Get(vehicle);

if (&xdata) {
if (&xdata != nullptr) {
// Reset last damage;
xdata.lastDamagePed = nullptr;
xdata.lastDamageType = 0;
Expand Down
26 changes: 13 additions & 13 deletions CLEOPlus/Misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1260,21 +1260,21 @@ OpcodeResult WINAPI GET_CHAR_DAMAGE_LAST_FRAME(CScriptThread* thread)
int ref = CLEO_GetIntOpcodeParam(thread);
CPed *ped = CPools::GetPed(ref);
PedExtended &data = extData.Get(ped);
if (&data)
{
CLEO_SetIntOpcodeParam(thread, -1);
CLEO_SetIntOpcodeParam(thread, -1);
CLEO_SetIntOpcodeParam(thread, -1);
CLEO_SetFloatOpcodeParam(thread, 0.0f);
}
else
if (&data != nullptr)
{
CLEO_SetIntOpcodeParam(thread, (DWORD)data.lastDamageEntity);
CLEO_SetIntOpcodeParam(thread, data.lastDamageWeapon);
CLEO_SetIntOpcodeParam(thread, data.lastDamagePart);
CLEO_SetFloatOpcodeParam(thread, data.lastDamageIntensity);
if (data.lastDamageIntensity > 0.0f) bResult = true;
}
else
{
CLEO_SetIntOpcodeParam(thread, -1);
CLEO_SetIntOpcodeParam(thread, -1);
CLEO_SetIntOpcodeParam(thread, -1);
CLEO_SetFloatOpcodeParam(thread, 0.0f);
}
reinterpret_cast<CRunningScript*>(thread)->UpdateCompareFlag(bResult);
return OR_CONTINUE;
}
Expand All @@ -1289,11 +1289,6 @@ OpcodeResult WINAPI GET_CAR_WEAPON_DAMAGE_LAST_FRAME(CScriptThread* thread)
int pedReturn = -1;

if (&data != nullptr) {
CLEO_SetIntOpcodeParam(thread, pedReturn);
CLEO_SetIntOpcodeParam(thread, -1);
CLEO_SetFloatOpcodeParam(thread, 0.0f);
}
else {
if (data.lastDamagePed) {
pedReturn = CPools::GetPedRef((CPed*)data.lastDamagePed);
}
Expand All @@ -1303,6 +1298,11 @@ OpcodeResult WINAPI GET_CAR_WEAPON_DAMAGE_LAST_FRAME(CScriptThread* thread)
CLEO_SetIntOpcodeParam(thread, data.lastDamageType);
CLEO_SetFloatOpcodeParam(thread, data.lastDamageIntensity);
}
else {
CLEO_SetIntOpcodeParam(thread, pedReturn);
CLEO_SetIntOpcodeParam(thread, -1);
CLEO_SetFloatOpcodeParam(thread, 0.0f);
}
reinterpret_cast<CRunningScript*>(thread)->UpdateCompareFlag(bResult);
return OR_CONTINUE;
}
Expand Down

0 comments on commit fd113b1

Please sign in to comment.