CBaseServerVehicle::FindSeatIndexByName
0x00b3b750 · 170 bytes · __thiscall
_ZN18CBaseServerVehicle19FindSeatIndexByNameEi8string_t
Decompiled
undefined (3 params)
/* CBaseServerVehicle::FindSeatIndexByName(int, string_t) */
int __thiscall
CBaseServerVehicle::FindSeatIndexByName(CBaseServerVehicle *this,int param_1,char *param_3)
{
int iVar1;
int iVar2;
CBaseAnimating *this_00;
int iVar3;
int *piVar4;
char *pcVar5;
int iVar6;
if ((((-1 < param_1) && (param_1 < *(int *)(this + 0x24))) &&
(iVar2 = (**(code **)(*(int *)this + 0x20))(this), iVar2 != 0)) &&
(this_00 = (CBaseAnimating *)
__dynamic_cast(iVar2,&CBaseEntity::typeinfo,&CBaseAnimating::typeinfo,0),
this_00 != (CBaseAnimating *)0x0)) {
pcVar5 = "";
if (param_3 != (char *)0x0) {
pcVar5 = param_3;
}
iVar3 = CBaseAnimating::LookupAttachment(this_00,pcVar5);
iVar2 = *(int *)(this + 0x18) + param_1 * 0x18;
iVar1 = *(int *)(iVar2 + 0x10);
if (0 < iVar1) {
iVar2 = *(int *)(iVar2 + 4);
if (iVar3 == *(int *)(iVar2 + 4)) {
return 0;
}
iVar6 = 0;
piVar4 = (int *)(iVar2 + 0x34);
while (iVar6 = iVar6 + 1, iVar6 != iVar1) {
iVar2 = *piVar4;
piVar4 = piVar4 + 0xc;
if (iVar3 == iVar2) {
return iVar6;
}
}
}
}
return -1;
}
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.