bool fight;
int __fastcall Hook_zCWorld_TraceRayFirstHit(zCWorld*, zVEC3 const&, zVEC3 const&, zCArray<zCVob*> const*, int);
CInvoke<int(__fastcall*)(zCWorld*, zVEC3 const&, zVEC3 const&, zCArray<zCVob*> const*, int)> Ivk_zCWorld_TraceRayFirstHit(0x00621960, &Hook_zCWorld_TraceRayFirstHit);
int __fastcall Hook_zCWorld_TraceRayFirstHit(zCWorld* _this, zVEC3 const& a1, zVEC3 const& a2, zCArray<zCVob*> const* a3, int a4)
{
if (fight)
{
return 0;
}
int result = Ivk_zCWorld_TraceRayFirstHit(_this, a1, a2, a3, a4);
return result;
}
void __fastcall Hook_oCNpc_Fighting(oCNpc*, void*);
CInvoke<void(__thiscall*)(oCNpc*)> Ivk_oCNpc_Fighting(0x006800B0, &Hook_oCNpc_Fighting);
void __fastcall Hook_oCNpc_Fighting(oCNpc* _this, void* vtable)
{
Scope scope("Fighting");
scope.LogThis(_this);
scope.LogArg(_this->enemy);
fight = false;
if (_this == player->focus_vob)
{
fight = true;
}
Ivk_oCNpc_Fighting(_this);
fight = false;
}