OnVomitCollide
0x004e5320 · 1132 bytes · __cdecl
_Z14OnVomitCollideP13CTerrorPlayerP11CBaseEntityS2_i6VectorS3_
Decompiled
undefined (6 params)
/* OnVomitCollide(CTerrorPlayer*, CBaseEntity*, CBaseEntity*, int, Vector, Vector) */
void OnVomitCollide(CTerrorPlayer *param_1,CBaseEntity *param_2,CBaseEntity *param_3,int param_4,
float param_5,float param_6,float param_7,float param_8,float param_9,
float param_10)
{
char cVar1;
int iVar2;
int iVar3;
float local_ec;
float local_e8;
float local_e4;
CTraceFilterSimple local_e0 [16];
Vector local_d0 [12];
float local_c4;
float local_c0;
float local_bc;
CBaseEntity *local_84;
float local_7c;
float local_78;
float local_74;
undefined4 local_70;
float local_6c;
float local_68;
float local_64;
float local_60;
float local_5c;
undefined4 local_58;
undefined4 local_54;
undefined4 local_50;
undefined4 local_4c;
int local_48;
undefined4 local_44;
undefined4 local_40;
undefined4 local_3c;
undefined4 local_38;
undefined2 local_34;
undefined4 local_30;
undefined4 local_2c;
undefined4 local_28;
undefined1 local_24;
undefined1 local_23;
local_ec = param_5;
local_e8 = param_6;
local_e4 = param_7;
VectorNormalize((Vector *)&local_ec);
local_3c = 0;
local_6c = local_ec * 80.0;
local_e4 = local_e4 - 0.2;
local_68 = local_e8 * 80.0;
local_64 = local_e4 * 80.0;
local_44 = 0;
local_48 = 0;
local_4c = 0;
local_54 = 0;
local_58 = 0;
local_5c = 0.0;
local_38._0_2_ =
CONCAT11(local_68 * local_68 + local_6c * local_6c + local_64 * local_64 != 0.0,1);
local_7c = param_8;
local_78 = param_9;
local_74 = param_10;
CTraceFilterSimple::CTraceFilterSimple
(local_e0,(IHandleEntity *)param_3,0,(_func_bool_IHandleEntity_ptr_int *)0x0);
(**(code **)(*enginetrace + 0x14))(enginetrace,&local_7c,0x46004003,local_e0,local_d0);
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
DebugDrawLine(local_d0,(Vector *)&local_c4,0xff,0,0,true,-1.0);
}
VectorNormalize((Vector *)&local_ec);
CTraceFilterSimple::CTraceFilterSimple
(local_e0,(IHandleEntity *)param_1,0,(_func_bool_IHandleEntity_ptr_int *)0x0);
local_78 = local_e8 * 120.0 + param_9;
local_74 = local_e4 * 120.0 + param_10;
local_7c = local_ec * 120.0 + param_8;
UTIL_ClipTraceToPlayers
((Vector *)¶m_8,(Vector *)&local_7c,0x46004003,(ITraceFilter *)local_e0,
(CGameTrace *)local_d0);
if (((local_84 != (CBaseEntity *)0x0) && (local_84 == param_2)) &&
((cVar1 = (**(code **)(*(int *)param_2 + 0x16c))(param_2),
iVar2 = IPredictionSystem::g_pPredictionSystems, cVar1 == '\0' ||
(iVar3 = CBaseEntity::GetTeamNumber(local_84), iVar2 = IPredictionSystem::g_pPredictionSystems
, iVar3 == param_4)))) {
for (; iVar2 != 0; iVar2 = *(int *)(iVar2 + 4)) {
*(int *)(iVar2 + 0x10) = *(int *)(iVar2 + 0x10) + 1;
}
/* try { // try from 004e5646 to 004e5757 has its CatchHandler @ 004e579c */
UTIL_BloodDecalTrace((CGameTrace *)local_d0,0);
local_24 = 0;
local_70 = 0;
local_7c = local_c4;
local_6c = 0.0;
local_78 = local_c0;
local_34 = 0;
local_74 = local_bc;
local_60 = -local_e8;
local_5c = -local_e4;
local_68 = 0.0;
local_64 = -local_ec;
local_58 = 0;
local_54 = 0;
local_50 = 0;
local_4c = 0;
local_44 = 0x3f800000;
local_38 = 0;
local_3c = 0;
local_30 = 0;
local_2c = 0;
local_28 = 0;
local_23 = 0;
if ((local_84 == (CBaseEntity *)0x0) || (*(int *)(local_84 + 0x30) == 0)) {
local_48 = 0;
}
else {
local_48 = *(int *)(local_84 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
local_40 = 0x41a00000;
DispatchEffect("csblood",(CEffectData *)&local_7c);
for (iVar2 = IPredictionSystem::g_pPredictionSystems; iVar2 != 0; iVar2 = *(int *)(iVar2 + 4)) {
*(int *)(iVar2 + 0x10) = *(int *)(iVar2 + 0x10) + -1;
}
}
iVar2 = CBaseEntity::GetTeamNumber(param_2);
if ((param_4 == iVar2) || (cVar1 = (**(code **)(*(int *)param_2 + 0x16c))(param_2), cVar1 == '\0')
) {
if (param_3 != (CBaseEntity *)0x0) {
UTIL_Remove(param_3);
}
}
else {
cVar1 = (**(code **)(*(int *)param_2 + 0x16c))(param_2);
if (cVar1 != '\0') {
iVar2 = CBaseEntity::GetTeamNumber(param_2);
cVar1 = IsASurvivorTeam(iVar2);
if ((cVar1 != '\0') &&
(cVar1 = (**(code **)(*(int *)param_2 + 0x550))(param_2), cVar1 == '\0')) {
CTerrorPlayer::OnHitSurvivorWithVomit(param_1,*(undefined4 *)(param_2 + 0x2ba0));
}
if ((param_1 == (CTerrorPlayer *)0x0) ||
(cVar1 = (**(code **)(*(int *)param_1 + 0x16c))(param_1), cVar1 == '\0')) {
param_1 = (CTerrorPlayer *)0x0;
}
CTerrorPlayer::OnVomitedUpon((CTerrorPlayer *)param_2,param_1,false);
return;
}
}
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.