CFourWheelVehiclePhysics::Initialize
0x006ad4e0 · 735 bytes · __thiscall
_ZN24CFourWheelVehiclePhysics10InitializeEPKcj
Decompiled
undefined (3 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CFourWheelVehiclePhysics::Initialize(char const*, unsigned int) */
undefined4 __thiscall
CFourWheelVehiclePhysics::Initialize(CFourWheelVehiclePhysics *this,char *param_1,uint param_2)
{
ushort uVar1;
uint uVar2;
undefined4 uVar3;
CBaseEntity *pCVar4;
undefined4 uVar5;
undefined *puVar6;
int *piVar7;
int iVar8;
int iVar9;
int in_GS_OFFSET;
CBaseEntity *local_910;
vehicleparams_t local_900 [516];
undefined4 local_6fc;
float local_6ec;
solid_t local_660 [1600];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
uVar2 = *(uint *)(this + 4);
if (uVar2 == 0xffffffff) {
piVar7 = (int *)0x0;
if (_DAT_00000238 == 0) goto LAB_006ad59d;
LAB_006ad555:
(**(code **)(*(int *)piVar7[0x8e] + 0x34))((int *)piVar7[0x8e],0);
uVar2 = *(uint *)(this + 4);
piVar7 = (int *)0x0;
if (uVar2 == 0xffffffff) goto LAB_006ad59d;
}
else {
puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10;
if (puVar6 == (undefined *)0xfffffffc) {
piVar7 = (int *)0x0;
if (_DAT_00000238 != 0) goto LAB_006ad555;
}
else {
if (*(uint *)(puVar6 + 8) == uVar2 >> 0xc) {
iVar8 = *(int *)(puVar6 + 4);
}
else {
iVar8 = 0;
}
if (*(int *)(iVar8 + 0x238) != 0) {
if (*(uint *)(puVar6 + 8) == uVar2 >> 0xc) {
piVar7 = *(int **)(puVar6 + 4);
}
else {
piVar7 = (int *)0x0;
}
goto LAB_006ad555;
}
}
}
puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10;
if ((puVar6 == (undefined *)0xfffffffc) || (*(uint *)(puVar6 + 8) != uVar2 >> 0xc)) {
piVar7 = (int *)0x0;
}
else {
piVar7 = *(int **)(puVar6 + 4);
}
LAB_006ad59d:
(**(code **)(*piVar7 + 0x298))(piVar7);
uVar3 = ParseVehicleScript(this,param_1,local_660,local_900);
if ((char)uVar3 == '\0') {
uVar2 = *(uint *)(this + 4);
if (((uVar2 == 0xffffffff) ||
(puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar6 + 8) != uVar2 >> 0xc)) {
pCVar4 = (CBaseEntity *)0x0;
}
else {
pCVar4 = *(CBaseEntity **)(puVar6 + 4);
}
UTIL_Remove(pCVar4);
}
else {
*(undefined4 *)(this + 0x120) = 0x461c4000;
if (0.0 < local_6ec) {
*(float *)(this + 0x120) = 1.0 / local_6ec;
}
puVar6 = g_pEntityList;
local_910 = (CBaseEntity *)0x0;
*(undefined4 *)(this + 0x48) = local_6fc;
uVar2 = *(uint *)(this + 4);
if (((uVar2 != 0xffffffff) &&
(puVar6 = puVar6 + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar6 + 8) == uVar2 >> 0xc)) {
local_910 = *(CBaseEntity **)(puVar6 + 4);
}
piVar7 = (int *)CBaseEntity::VPhysicsInitNormal(local_910,6,0x1000,0,local_660);
uVar1 = (**(code **)(*piVar7 + 0x50))(piVar7);
(**(code **)(*piVar7 + 0x4c))(piVar7,uVar1 | 0x8010);
iVar9 = 0;
piVar7 = (int *)(**(code **)(*physenv + 0x80))(physenv,piVar7,local_900,param_2,physgametrace);
*(int **)(this + 0x24) = piVar7;
iVar8 = (**(code **)(*piVar7 + 0x1c))(piVar7);
*(int *)(this + 0x60) = iVar8;
if (0 < iVar8) {
do {
uVar5 = (**(code **)(**(int **)(this + 0x24) + 0x20))(*(int **)(this + 0x24),iVar9);
*(undefined4 *)(this + iVar9 * 4 + 0x50) = uVar5;
iVar9 = iVar9 + 1;
} while (iVar9 < *(int *)(this + 0x60));
}
}
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
return uVar3;
}
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.