CreateKeepUpright
0x007a5100 · 191 bytes · __cdecl
_Z17CreateKeepUprightRK6VectorRK6QAngleP11CBaseEntityfb
Decompiled
undefined (5 params)
/* CreateKeepUpright(Vector const&, QAngle const&, CBaseEntity*, float, bool) */
int * CreateKeepUpright(Vector *param_1,QAngle *param_2,CBaseEntity *param_3,float param_4,
bool param_5)
{
CBaseEdict *this;
int *piVar1;
int *piVar2;
int iVar3;
uint uVar4;
piVar1 = (int *)CBaseEntity::Create("phys_keepupright",param_1,param_2,param_3);
if (piVar1 != (int *)0x0) {
if (param_3 == (CBaseEntity *)0x0) {
piVar1[0x119] = -1;
}
else {
piVar2 = (int *)(**(code **)(*(int *)param_3 + 0xc))(param_3);
piVar1[0x119] = *piVar2;
}
piVar1[0x11a] = (int)param_4;
if ((!param_5) && (uVar4 = piVar1[0x52] | 1, piVar1[0x52] != uVar4)) {
if ((char)piVar1[0x1b] == '\0') {
this = (CBaseEdict *)piVar1[0xc];
if (this != (CBaseEdict *)0x0) {
*(uint *)this = *(uint *)this | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(this);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
*(byte *)(piVar1 + 0x1c) = *(byte *)(piVar1 + 0x1c) | 1;
}
piVar1[0x52] = uVar4;
}
(**(code **)(*piVar1 + 100))(piVar1);
(**(code **)(*piVar1 + 0x94))(piVar1);
}
return piVar1;
}
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.