CCarProp::InputSurvivorStandingOnCar
0x007fefb0 · 1114 bytes · __thiscall
_ZN8CCarProp26InputSurvivorStandingOnCarER11inputdata_t
Decompiled
undefined (2 params)
/* CCarProp::InputSurvivorStandingOnCar(inputdata_t&) */
void __thiscall CCarProp::InputSurvivorStandingOnCar(CCarProp *this,inputdata_t *param_1)
{
CDirector *this_00;
char cVar1;
int *piVar2;
CBaseEntity *this_01;
longdouble lVar3;
float fVar4;
CCarProp *pCVar5;
code *pcVar6;
undefined4 uVar7;
undefined4 uVar8;
char *pcVar9;
undefined1 local_54 [8];
CAI_Concept local_4c [8];
undefined4 local_44;
undefined4 local_40;
AI_CriteriaSet local_3c [44];
this_01 = *(CBaseEntity **)param_1;
if (((this[0x1710] == (CCarProp)0x0) && (this[0x1711] == (CCarProp)0x0)) &&
(this[0x16f5] == (CCarProp)0x0)) {
if ((0.0 < *(float *)(this + 0x1700)) &&
(lVar3 = (longdouble)CountdownTimer::Now(), (float)lVar3 < *(float *)(this + 0x1700))) {
return;
}
if (this_01 != (CBaseEntity *)0x0) {
fVar4 = *(float *)(car_alarm_distance._28_4_ + 0x2c);
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
if (((byte)this_01[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(this_01);
}
if ((*(float *)(this_01 + 0x2e0) - *(float *)(this + 0x2e0)) *
(*(float *)(this_01 + 0x2e0) - *(float *)(this + 0x2e0)) +
(*(float *)(this_01 + 0x2e4) - *(float *)(this + 0x2e4)) *
(*(float *)(this_01 + 0x2e4) - *(float *)(this + 0x2e4)) +
(*(float *)(this_01 + 0x2e8) - *(float *)(this + 0x2e8)) *
(*(float *)(this_01 + 0x2e8) - *(float *)(this + 0x2e8)) <= fVar4 * fVar4) {
cVar1 = (**(code **)(*(int *)this_01 + 0x16c))(this_01);
if (cVar1 == '\0') {
this_01 = (CBaseEntity *)0x0;
}
else {
cVar1 = (**(code **)(*(int *)this_01 + 0x778))(this_01);
if (cVar1 != '\0') {
return;
}
}
cVar1 = CDirector::OnMapInvokedPanicEvent(TheDirector,this_01,1);
this_00 = TheDirector;
if (cVar1 != '\0') {
this[0x16f5] = (CCarProp)0x1;
CDirector::UnregisterForbiddenTarget(this_00,(CBaseEntity *)this);
this[0x16f4] = (CCarProp)0x0;
if (0.0 < *(float *)(this + 0x170c)) {
pcVar9 = "ContextAlarm";
uVar8 = 0;
CBaseEntity::ThinkSet((_func_void *)local_54,(float)this,(char *)0x0);
uVar7 = 0;
pCVar5 = this;
COutputEvent::FireOutput
((COutputEvent *)(this + 0x16dc),(CBaseEntity *)this,(CBaseEntity *)this,0.0);
if (*(float *)(this + 0x170c) != -1.0) {
(**(code **)(*(int *)(this + 0x1704) + 4))
(this + 0x1704,this + 0x170c,pCVar5,uVar7,uVar8,pcVar9);
*(undefined4 *)(this + 0x170c) = 0xbf800000;
}
}
CL4DGameStats::Event_CarAlarm((CL4DGameStats *)CL4D_GameStats);
COutputEvent::FireOutput
((COutputEvent *)(this + 0x1694),(CBaseEntity *)this,(CBaseEntity *)this,0.0);
fVar4 = *(float *)(car_alarm_duration._28_4_ + 0x2c);
lVar3 = (longdouble)CountdownTimer::Now();
if ((float)lVar3 + fVar4 != *(float *)(this + 0x1700)) {
(**(code **)(*(int *)(this + 0x16f8) + 4))(this + 0x16f8,this + 0x1700);
*(float *)(this + 0x1700) = (float)lVar3 + fVar4;
}
if (fVar4 != *(float *)(this + 0x16fc)) {
(**(code **)(*(int *)(this + 0x16f8) + 4))(this + 0x16f8,this + 0x16fc);
*(float *)(this + 0x16fc) = fVar4;
}
fVar4 = *(float *)(car_alarm_duration._28_4_ + 0x2c) + *(float *)(gpGlobals + 0xc);
pcVar9 = "ContextAlarm";
pcVar6 = AlarmEndThink;
uVar7 = 0;
CBaseEntity::ThinkSet((_func_void *)local_54,(float)this,(char *)AlarmEndThink);
if (this_01 != (CBaseEntity *)0x0) {
AI_CriteriaSet::AI_CriteriaSet(local_3c);
/* try { // try from 007ff28e to 007ff31b has its CatchHandler @ 007ff424 */
pcVar9 = (char *)SurvivorCharacterName
(*(undefined4 *)(this_01 + 0x2ba0),this,pcVar6,uVar7,fVar4,
pcVar9);
AI_CriteriaSet::AppendCriteria(local_3c,"Subject",pcVar9,1.0);
AI_CriteriaSet::AppendCriteria(local_3c,"PanicType","CarAlarm",1.0);
local_44 = 1;
local_40 = 0xffffffff;
CAI_Concept::CAI_Concept(local_4c,"PanicEvent");
CResponseQueue::Add((CResponseQueue *)g_ResponseQueueManager._12_4_,local_4c,local_3c,
0.0,(CFollowupTargetSpec_t *)&local_44,(CBaseEntity *)0x0);
AI_CriteriaSet::~AI_CriteriaSet(local_3c);
}
piVar2 = (int *)(**(code **)(*gameeventmanager + 0x1c))
(gameeventmanager,"triggered_car_alarm",0,0);
if (piVar2 != (int *)0x0) {
pcVar6 = *(code **)(*piVar2 + 0x30);
uVar7 = 0;
if (this_01 != (CBaseEntity *)0x0) {
uVar7 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this_01 + 0x30));
}
(*pcVar6)(piVar2,"userid",uVar7);
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar2,0);
}
}
}
}
}
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.