CBasePropDoor::DoorClose
0x007f4420 · 713 bytes · __thiscall
_ZN13CBasePropDoor9DoorCloseEv
Decompiled
undefined (1 param)
/* CBasePropDoor::DoorClose() */
void __thiscall CBasePropDoor::DoorClose(CBasePropDoor *this)
{
uint uVar1;
CBaseEdict *this_00;
int *piVar2;
char cVar3;
undefined1 uVar4;
char *pcVar5;
int *piVar6;
undefined4 uVar7;
int iVar8;
undefined *puVar9;
int iVar10;
code *pcVar11;
if (*(int *)(this + 0x15f4) == 0) {
return;
}
if (*(int *)(this + 0x15f4) == 3) {
return;
}
if (((byte)this[0x149] & 0x10) == 0) {
pcVar5 = "";
if (*(char **)(this + 0x1648) != (char *)0x0) {
pcVar5 = *(char **)(this + 0x1648);
}
CBaseEntity::EmitSound((CBaseEntity *)this,pcVar5,0.0,(float *)0x0);
uVar1 = *(uint *)(this + 0x1620);
if ((((uVar1 != 0xffffffff) &&
(puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar9 + 8) == uVar1 >> 0xc)) &&
((piVar6 = *(int **)(puVar9 + 4), piVar6 != (int *)0x0 &&
(cVar3 = (**(code **)(*piVar6 + 0x16c))(piVar6), cVar3 != '\0')))) {
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
CSoundEnt::InsertSound
(4,(Vector *)(this + 0x2e0),0x200,0.5,(CBaseEntity *)this,0,(CBaseEntity *)0x0);
}
if (*(int *)(this + 0x15f4) == 3) goto LAB_007f4515;
}
if (this[0x6c] == (CBasePropDoor)0x0) {
this_00 = *(CBaseEdict **)(this + 0x30);
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar8 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar8 + 2) = 0;
}
}
else {
this[0x70] = (CBasePropDoor)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x15f4) = 3;
LAB_007f4515:
*(code **)(this + 0x14) = DoorCloseMoveDone;
*(undefined4 *)(this + 0x18) = 0;
(**(code **)(*(int *)this + 0x4b0))(this);
piVar6 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"door_close",0,0);
if (piVar6 != (int *)0x0) {
uVar1 = *(uint *)(this + 0x1620);
if (((uVar1 == 0xffffffff) ||
(puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
((*(uint *)(puVar9 + 8) != uVar1 >> 0xc ||
((piVar2 = *(int **)(puVar9 + 4), piVar2 == (int *)0x0 ||
(cVar3 = (**(code **)(*piVar2 + 0x16c))(piVar2), cVar3 == '\0')))))) {
pcVar11 = *(code **)(*piVar6 + 0x30);
uVar7 = 0;
}
else {
pcVar11 = *(code **)(*piVar6 + 0x30);
uVar7 = (**(code **)(*engine + 0x40))(engine,piVar2[0xc]);
}
(*pcVar11)(piVar6,"userid",uVar7);
pcVar11 = *(code **)(*piVar6 + 0x30);
uVar4 = (**(code **)(*(int *)this + 0x478))(this);
(*pcVar11)(piVar6,"checkpoint",uVar4);
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar6,0);
}
COutputEvent::FireOutput
((COutputEvent *)(this + 0x16fc),(CBaseEntity *)this,(CBaseEntity *)this,0.0);
iVar8 = *(int *)(this + 0x15e8);
if (0 < iVar8) {
iVar10 = 0;
do {
while ((((uVar1 = *(uint *)(*(int *)(this + 0x15dc) + iVar10 * 4), uVar1 != 0xffffffff &&
(puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc))
&& (*(uint *)(puVar9 + 8) == uVar1 >> 0xc)) &&
(*(CBasePropDoor **)(puVar9 + 4) != (CBasePropDoor *)0x0))) {
iVar10 = iVar10 + 1;
DoorClose(*(CBasePropDoor **)(puVar9 + 4));
if (iVar10 == iVar8) {
return;
}
}
iVar10 = iVar10 + 1;
} while (iVar10 != iVar8);
}
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.