CSurvivorRescue::CallForHelp
0x00969f80 · 1340 bytes · __thiscall
_ZN15CSurvivorRescue11CallForHelpEP13CTerrorPlayer
Decompiled
undefined (2 params)
/* CSurvivorRescue::CallForHelp(CTerrorPlayer*) */
void __thiscall CSurvivorRescue::CallForHelp(CSurvivorRescue *this,CTerrorPlayer *param_1)
{
float fVar1;
CBaseEdict *this_00;
char cVar2;
uint uVar3;
int iVar4;
undefined4 *puVar5;
undefined4 uVar6;
undefined4 uVar7;
undefined *puVar8;
undefined4 uVar9;
CCSPlayer *pCVar10;
uint uVar11;
int *piVar12;
CTerrorPlayer *pCVar13;
double dVar14;
double dVar15;
code *pcVar16;
longlong lVar17;
undefined8 uVar18;
undefined1 local_24 [20];
uVar3 = *(uint *)(this + 0x1920);
if (uVar3 == 0xffffffff) {
LAB_0096a4f2:
if (param_1 == (CTerrorPlayer *)0x0) {
return;
}
LAB_00969fee:
pCVar13 = (CTerrorPlayer *)0x0;
}
else {
uVar11 = uVar3 & 0xfff;
piVar12 = (int *)(g_pEntityList + uVar11 * 0x10 + 4);
if (piVar12 == (int *)0x0) goto LAB_0096a4f2;
if (*(uint *)(g_pEntityList + uVar11 * 0x10 + 8) == uVar3 >> 0xc) {
pCVar13 = *(CTerrorPlayer **)(g_pEntityList + uVar11 * 0x10 + 4);
}
else {
pCVar13 = (CTerrorPlayer *)0x0;
}
if (param_1 == pCVar13) {
return;
}
if (((*(uint *)(g_pEntityList + uVar11 * 0x10 + 8) == uVar3 >> 0xc) &&
(*(CBaseEntity **)(g_pEntityList + uVar11 * 0x10 + 4) != (CBaseEntity *)0x0)) &&
(param_1 == (CTerrorPlayer *)0x0)) {
iVar4 = CBaseEntity::GetTeamNumber(*(CBaseEntity **)(g_pEntityList + uVar11 * 0x10 + 4));
if (iVar4 == 2) {
uVar3 = *(uint *)(this + 0x1920);
piVar12 = (int *)0x0;
if (uVar3 != 0xffffffff) {
puVar8 = g_pEntityList + (uVar3 & 0xfff) * 0x10;
if ((puVar8 == (undefined *)0xfffffffc) || (*(uint *)(puVar8 + 8) != uVar3 >> 0xc)) {
piVar12 = (int *)0x0;
}
else {
piVar12 = *(int **)(puVar8 + 4);
}
}
cVar2 = (**(code **)(*piVar12 + 300))(piVar12);
if (cVar2 == '\0') {
uVar3 = *(uint *)(this + 0x1920);
pCVar10 = (CCSPlayer *)0x0;
if (((uVar3 != 0xffffffff) &&
(puVar8 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc))
&& (*(uint *)(puVar8 + 8) == uVar3 >> 0xc)) {
pCVar10 = *(CCSPlayer **)(puVar8 + 4);
}
CCSPlayer::State_Transition(pCVar10,6);
}
}
uVar3 = *(uint *)(this + 0x1920);
if ((uVar3 != 0xffffffff) &&
(piVar12 = (int *)(g_pEntityList + (uVar3 & 0xfff) * 0x10 + 4), piVar12 != (int *)0x0))
goto LAB_00969fe2;
goto LAB_00969fee;
}
LAB_00969fe2:
if (piVar12[1] != uVar3 >> 0xc) goto LAB_00969fee;
pCVar13 = (CTerrorPlayer *)*piVar12;
}
if (param_1 != pCVar13) {
if (this[0x6c] == (CSurvivorRescue)0x0) {
this_00 = *(CBaseEdict **)(this + 0x30);
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar4 + 2) = 0;
}
}
else {
this[0x70] = (CSurvivorRescue)((byte)this[0x70] | 1);
}
if (param_1 == (CTerrorPlayer *)0x0) {
*(undefined4 *)(this + 0x1920) = 0xffffffff;
}
else {
puVar5 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
*(undefined4 *)(this + 0x1920) = *puVar5;
}
}
CBaseEntity::DispatchUpdateTransmitState((CBaseEntity *)this);
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
uVar6 = 0;
iVar4 = CNavMesh::GetNearestNavArea
(TheNavMesh,(Vector *)(this + 0x2e0),false,10000.0,false,true,false);
if (param_1 == (CTerrorPlayer *)0x0) {
CBaseEntity::ThinkSet((_func_void *)local_24,(float)this,(char *)0x0);
CBaseEntity::ThinkSet((_func_void *)local_24,(float)this,(char *)0x0);
if (iVar4 == 0) {
uVar6 = 0xffffffff;
}
else {
uVar6 = *(undefined4 *)(iVar4 + 0x8c);
}
if (((byte)this[0x14d] & 8) == 0) {
dVar15 = (double)*(float *)(this + 0x2e8);
}
else {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
dVar15 = (double)*(float *)(this + 0x2e8);
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
dVar14 = (double)*(float *)(this + 0x2e4);
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
goto LAB_0096a42c;
}
}
dVar14 = (double)*(float *)(this + 0x2e4);
LAB_0096a42c:
UTIL_LogPrintf("(RESCUE) Rescue spot at %.0f, %.0f, %.0f (area %d) deactivated.\n",
(double)*(float *)(this + 0x2e0),dVar14,dVar15,uVar6);
return;
}
*(undefined4 *)(this + 0x1930) = 0;
if ((iVar4 != 0) && (0.0 <= *(float *)(iVar4 + 0x154))) {
*(float *)(this + 0x1930) = *(float *)(iVar4 + 0x154);
}
fVar1 = *(float *)(RescueYellDelay._28_4_ + 0x2c);
CBaseEntity::ThinkSet((_func_void *)local_24,(float)this,(char *)YellThink);
uVar18 = CONCAT44(uVar6,"Rescue");
pcVar16 = RescueThink;
lVar17 = (ulonglong)(uint)(fVar1 + *(float *)(gpGlobals + 0xc) + 0.5) << 0x20;
CBaseEntity::ThinkSet((_func_void *)local_24,(float)this,(char *)RescueThink);
uVar6 = (**(code **)(*engine + 0x40))
(engine,*(undefined4 *)(param_1 + 0x30),pcVar16,lVar17,uVar18);
uVar7 = (**(code **)(*(int *)param_1 + 0xb8))(param_1);
if (iVar4 == 0) {
uVar9 = 0xffffffff;
}
else {
uVar9 = *(undefined4 *)(iVar4 + 0x8c);
}
if (((byte)this[0x14d] & 8) == 0) {
dVar15 = (double)*(float *)(this + 0x2e8);
}
else {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
dVar15 = (double)*(float *)(this + 0x2e8);
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
dVar14 = (double)*(float *)(this + 0x2e4);
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
goto LAB_0096a19d;
}
}
dVar14 = (double)*(float *)(this + 0x2e4);
LAB_0096a19d:
UTIL_LogPrintf("(RESCUE) Rescue spot at %.0f, %.0f, %.0f (area %d) activated for %s(%d).\n",
(double)*(float *)(this + 0x2e0),dVar14,dVar15,uVar9,uVar7,uVar6);
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.