CBaseEntity::OnEntityEvent
0x00601970 · 288 bytes · __thiscall
_ZN11CBaseEntity13OnEntityEventE13EntityEvent_tPv
Decompiled
undefined (3 params)
/* CBaseEntity::OnEntityEvent(EntityEvent_t, void*) */
void __thiscall CBaseEntity::OnEntityEvent(CBaseEntity *param_1,int param_2,uint param_3)
{
uint uVar1;
if (param_2 == 0) {
if ((param_3 == 0) || ((param_3 & 0x20) != 0)) {
param_1[0x250] = (CBaseEntity)((char)param_1[0x250] + '\x01');
}
if ((param_3 & 0x10) != 0) {
param_1[0x251] = (CBaseEntity)((char)param_1[0x251] + '\x01');
}
}
else {
if (param_2 != 1) {
return;
}
if ((param_3 == 0) || ((param_3 & 0x20) != 0)) {
param_1[0x250] = (CBaseEntity)((char)param_1[0x250] + -1);
}
if ((param_3 & 0x10) != 0) {
param_1[0x251] = (CBaseEntity)((char)param_1[0x251] + -1);
}
}
if (param_1[0x186] != (CBaseEntity)0x6) {
return;
}
uVar1 = ~-(uint)(param_1[0x250] == (CBaseEntity)0x0) & 0x20;
if (param_1[0x251] != (CBaseEntity)0x0) {
uVar1 = uVar1 | 0x10;
}
if (uVar1 != 0) {
if (param_1[0x253] != (CBaseEntity)0x1) {
(**(code **)(*(int *)param_1 + 0x2ec))(param_1,param_1 + 0x253);
param_1[0x253] = (CBaseEntity)0x1;
}
SetWaterType(param_1,uVar1);
return;
}
if (param_1[0x253] != (CBaseEntity)0x0) {
(**(code **)(*(int *)param_1 + 0x2ec))(param_1,param_1 + 0x253);
param_1[0x253] = (CBaseEntity)0x0;
}
SetWaterType(param_1,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.