Checkpoint::Update
0x0086b380 · 1304 bytes · __thiscall
_ZN10Checkpoint6UpdateEv
Decompiled
undefined (1 param)
/* Checkpoint::Update() */
void __thiscall Checkpoint::Update(Checkpoint *this)
{
CNavArea *this_00;
uint uVar1;
int *piVar2;
CBaseEntity *pCVar3;
float fVar4;
char cVar5;
Vector *pVVar6;
char *pcVar7;
float fVar8;
undefined *puVar9;
char *pcVar10;
int iVar11;
int iVar12;
int iVar13;
int in_GS_OFFSET;
int local_80;
float local_78;
float local_74;
float local_70;
Checkpoint *local_6c;
float local_68;
float local_64;
char local_60 [64];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (*(int *)(ZombieCheckpointDebug._28_4_ + 0x30) != 0) {
iVar12 = 0;
if (0 < *(int *)(this + 0x54)) {
do {
while ((((uVar1 = *(uint *)(*(int *)(this + 0x48) + iVar12 * 4), uVar1 != 0xffffffff &&
(puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc
)) && (*(uint *)(puVar9 + 8) == uVar1 >> 0xc)) &&
(piVar2 = *(int **)(puVar9 + 4), piVar2 != (int *)0x0))) {
iVar12 = iVar12 + 1;
pVVar6 = (Vector *)(**(code **)(*piVar2 + 0x288))(piVar2);
NDebugOverlay::Cross3D(pVVar6,10.0,0xff,0xff,0xff,true,0.1);
if (*(int *)(this + 0x54) <= iVar12) goto LAB_0086b447;
}
iVar12 = iVar12 + 1;
} while (iVar12 < *(int *)(this + 0x54));
}
LAB_0086b447:
local_80 = 0;
if (0 < *(int *)(this + 0xc)) {
LAB_0086b460:
do {
this_00 = *(CNavArea **)(*(int *)this + local_80 * 4);
if (0 < *(int *)(this + 0x54)) {
iVar12 = 0;
do {
uVar1 = *(uint *)(*(int *)(this + 0x48) + iVar12 * 4);
if (((uVar1 != 0xffffffff) &&
(puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)
) && ((*(uint *)(puVar9 + 8) == uVar1 >> 0xc &&
(piVar2 = *(int **)(puVar9 + 4), piVar2 != (int *)0x0)))) {
pVVar6 = (Vector *)(**(code **)(*piVar2 + 0x288))(piVar2);
cVar5 = CNavArea::IsOverlapping(this_00,pVVar6,0.0);
if (cVar5 != '\0') {
local_80 = local_80 + 1;
if (local_80 < *(int *)(this + 0xc)) goto LAB_0086b460;
goto LAB_0086b4f3;
}
}
iVar12 = iVar12 + 1;
} while (iVar12 < *(int *)(this + 0x54));
}
(**(code **)(*(int *)this_00 + 0x50))(this_00);
local_80 = local_80 + 1;
} while (local_80 < *(int *)(this + 0xc));
}
LAB_0086b4f3:
pcVar10 = "OPEN TO ALL";
if (this[0x5d] != (Checkpoint)0x0) {
pcVar10 = "NO ZOMBIES";
}
pcVar7 = "USED";
if (this[0x5c] == (Checkpoint)0x0) {
pcVar7 = "UNUSED";
}
V_snprintf(local_60,0x40,"%s %s",pcVar7,pcVar10);
if (this[0x5f] != (Checkpoint)0x0) {
V_strncat(local_60," OUTWARD",0x40,-1);
}
iVar12 = 0;
local_68 = (*(float *)(this + 0x28) + *(float *)(this + 0x1c)) * 0.5;
local_6c = (Checkpoint *)((*(float *)(this + 0x24) + *(float *)(this + 0x18)) * 0.5);
local_64 = (*(float *)(this + 0x2c) + *(float *)(this + 0x20)) * 0.5 + 10.0;
NDebugOverlay::Text((Vector *)&local_6c,local_60,false,0.1);
local_6c = (Checkpoint *)(*(float *)(this + 0x24) + 25.0);
local_68 = *(float *)(this + 0x28) + 25.0;
local_64 = *(float *)(this + 0x2c) + 71.0;
local_78 = *(float *)(this + 0x18) - 25.0;
local_74 = *(float *)(this + 0x1c) - 25.0;
local_70 = *(float *)(this + 0x20) - 25.0;
NDebugOverlay::Box((Vector *)&vec3_origin,(Vector *)&local_78,(Vector *)&local_6c,0xff,0xff,0xff
,0x28,0.1);
if (0 < *(int *)(this + 0x54)) {
do {
while (((uVar1 = *(uint *)(*(int *)(this + 0x48) + iVar12 * 4), uVar1 == 0xffffffff ||
(puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)
) || ((*(uint *)(puVar9 + 8) != uVar1 >> 0xc ||
(pCVar3 = *(CBaseEntity **)(puVar9 + 4), pCVar3 == (CBaseEntity *)0x0))))) {
iVar12 = iVar12 + 1;
if (*(int *)(this + 0x54) <= iVar12) goto LAB_0086b780;
}
if (*(int *)(pCVar3 + 0x15f4) == 0) {
iVar13 = 0xff;
NDebugOverlay::EntityBounds(pCVar3,0xff,0,0,0x32,0.1);
iVar11 = 0;
}
else {
iVar13 = 0;
NDebugOverlay::EntityBounds(pCVar3,0,0xff,0,0x32,0.1);
iVar11 = 0xff;
}
iVar12 = iVar12 + 1;
local_68 = (*(float *)(this + 0x28) + *(float *)(this + 0x1c)) * 0.5;
local_64 = (*(float *)(this + 0x2c) + *(float *)(this + 0x20)) * 0.5;
local_6c = (Checkpoint *)((*(float *)(this + 0x24) + *(float *)(this + 0x18)) * 0.5);
pVVar6 = (Vector *)(**(code **)(*(int *)pCVar3 + 0x288))(pCVar3);
NDebugOverlay::Line(pVVar6,(Vector *)&local_6c,iVar13,iVar11,0,true,0.1);
} while (iVar12 < *(int *)(this + 0x54));
}
}
LAB_0086b780:
cVar5 = CDirector::IsInTransition(TheDirector);
if (((cVar5 == '\0') && (this[0x5d] != (Checkpoint)0x0)) && (this[0x5f] == (Checkpoint)0x0)) {
local_6c = this;
local_68 = 0.0;
ForEachPlayer<CheckpointSurvivorCount>((CheckpointSurvivorCount *)&local_6c);
fVar4 = local_68;
if (local_68 != 0.0) {
fVar8 = (float)UTIL_HumansOnTeam(2,true);
if (fVar4 == fVar8) {
this[0x5e] = (Checkpoint)0x1;
}
if (local_68 != 0.0) goto LAB_0086b7a1;
}
if (this[0x5e] != (Checkpoint)0x0) {
TerrorNavMesh::OnCheckpointLeft(TheNavMesh);
}
}
LAB_0086b7a1:
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.