CSurvivorRescue::InputRescue
0x0096a500 · 1920 bytes · __thiscall
_ZN15CSurvivorRescue11InputRescueER11inputdata_t
Decompiled
undefined (2 params)
/* CSurvivorRescue::InputRescue(inputdata_t&) */
void __thiscall CSurvivorRescue::InputRescue(CSurvivorRescue *this,inputdata_t *param_1)
{
CCSPlayer CVar1;
CBaseEntity *pCVar2;
code *pcVar3;
char cVar4;
CCSPlayer *pCVar5;
int iVar6;
uint uVar7;
int iVar8;
CTerrorPlayer *pCVar9;
undefined *puVar10;
int *piVar11;
undefined4 uVar12;
int *piVar13;
longdouble lVar14;
double dVar15;
double dVar16;
CAI_Concept local_24 [20];
ValidateSurvivor(this);
uVar7 = *(uint *)(this + 0x1920);
if ((((uVar7 == 0xffffffff) ||
(puVar10 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar10 + 8) != uVar7 >> 0xc)) || (*(int *)(puVar10 + 4) == 0)) {
return;
}
CBaseEntity::EmitSound((CBaseEntity *)this,"Player.StopVoice",0.0,(float *)0x0);
uVar7 = *(uint *)(this + 0x1920);
iVar8 = 0;
if (((uVar7 != 0xffffffff) &&
(puVar10 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar10 + 8) == uVar7 >> 0xc)) {
iVar8 = *(int *)(puVar10 + 4);
}
Music::Reset((Music *)(iVar8 + 0x3ab4));
uVar7 = *(uint *)(this + 0x1920);
g_ActiveRescue = this;
if (((uVar7 == 0xffffffff) ||
(puVar10 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar10 + 8) != uVar7 >> 0xc)) {
pCVar5 = (CCSPlayer *)0x0;
CVar1 = DAT_00003fcd;
}
else {
pCVar5 = *(CCSPlayer **)(puVar10 + 4);
CVar1 = pCVar5[0x3fcd];
}
CCSPlayer::State_Transition(pCVar5,0);
uVar7 = *(uint *)(this + 0x1920);
piVar11 = (int *)0x0;
if (((uVar7 != 0xffffffff) &&
(puVar10 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar10 + 8) == uVar7 >> 0xc)) {
piVar11 = *(int **)(puVar10 + 4);
}
iVar8 = 0;
(**(code **)(*piVar11 + 100))(piVar11);
if (0 < DAT_01016aac) {
do {
pCVar2 = *(CBaseEntity **)(g_DeadSurvivors + iVar8 * 4);
if (pCVar2 != (CBaseEntity *)0x0) {
iVar6 = CTerrorPlayer::GetPlayerByCharacter(*(undefined4 *)(pCVar2 + 0x17d8));
uVar7 = *(uint *)(this + 0x1920);
if (((uVar7 == 0xffffffff) ||
(puVar10 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc))
|| (*(uint *)(puVar10 + 8) != uVar7 >> 0xc)) {
if (iVar6 == 0) goto LAB_0096a6d0;
}
else if (iVar6 == *(int *)(puVar10 + 4)) {
LAB_0096a6d0:
UTIL_Remove(pCVar2);
break;
}
}
iVar8 = iVar8 + 1;
} while (iVar8 < DAT_01016aac);
}
uVar7 = *(uint *)(this + 0x1920);
pCVar9 = (CTerrorPlayer *)0x0;
if (((uVar7 != 0xffffffff) &&
(puVar10 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar10 + 8) == uVar7 >> 0xc)) {
pCVar9 = *(CTerrorPlayer **)(puVar10 + 4);
}
CTerrorPlayer::RemoveSecondaryWeaponRestore(pCVar9);
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
iVar8 = CNavMesh::GetNearestNavArea
(TheNavMesh,(Vector *)(this + 0x2e0),false,10000.0,false,true,false);
if (iVar8 == 0) {
uVar12 = 0xffffffff;
}
else {
uVar12 = *(undefined4 *)(iVar8 + 0x8c);
}
if (((byte)this[0x14d] & 8) == 0) {
dVar16 = (double)*(float *)(this + 0x2e8);
}
else {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
dVar16 = (double)*(float *)(this + 0x2e8);
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
dVar15 = (double)*(float *)(this + 0x2e4);
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
goto LAB_0096a793;
}
}
dVar15 = (double)*(float *)(this + 0x2e4);
LAB_0096a793:
piVar11 = (int *)0x0;
UTIL_LogPrintf("(RESCUE) Rescue spot at %.0f, %.0f, %.0f (area %d) now spawning.\n",
(double)*(float *)(this + 0x2e0),dVar15,dVar16,uVar12);
iVar8 = *(int *)(ZombieSurvivorRespawnHealth._28_4_ + 0x30);
uVar7 = *(uint *)(this + 0x1920);
if (((uVar7 != 0xffffffff) &&
(puVar10 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar10 + 8) == uVar7 >> 0xc)) {
piVar11 = *(int **)(puVar10 + 4);
}
if (iVar8 != piVar11[0x40]) {
(**(code **)(*piVar11 + 0x214))(piVar11,piVar11 + 0x40);
piVar11[0x40] = iVar8;
uVar7 = *(uint *)(this + 0x1920);
}
pCVar9 = (CTerrorPlayer *)0x0;
if (((uVar7 != 0xffffffff) &&
(puVar10 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar10 + 8) == uVar7 >> 0xc)) {
pCVar9 = *(CTerrorPlayer **)(puVar10 + 4);
}
CTerrorPlayer::ApplyHealthModifications(pCVar9);
uVar7 = GetDifficulty();
if (uVar7 < 2) {
uVar7 = *(uint *)(this + 0x1920);
iVar8 = 0;
if (((uVar7 != 0xffffffff) &&
(puVar10 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar10 + 8) == uVar7 >> 0xc)) {
iVar8 = *(int *)(puVar10 + 4);
}
Intensity::Increase((Intensity *)(iVar8 + 12000),5);
}
uVar7 = *(uint *)(this + 0x1920);
piVar11 = (int *)0x0;
if (((uVar7 != 0xffffffff) &&
(puVar10 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar10 + 8) == uVar7 >> 0xc)) {
piVar11 = *(int **)(puVar10 + 4);
}
pcVar3 = *(code **)(*piVar11 + 0x7b4);
CAI_Concept::CAI_Concept(local_24,"PlayerThanks");
(*pcVar3)(piVar11,local_24,1,0,0,0,0);
g_ActiveRescue = (CSurvivorRescue *)0x0;
piVar11 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"survivor_rescued",0,0);
if (piVar11 != (int *)0x0) {
piVar13 = *(int **)param_1;
if ((piVar13 == (int *)0x0) || (cVar4 = (**(code **)(*piVar13 + 0x16c))(piVar13), cVar4 == '\0')
) {
(**(code **)(*piVar11 + 0x30))(piVar11,"rescuer");
}
else {
pcVar3 = *(code **)(*piVar11 + 0x30);
piVar13 = *(int **)param_1;
if ((piVar13 == (int *)0x0) ||
(cVar4 = (**(code **)(*piVar13 + 0x16c))(piVar13), cVar4 == '\0')) {
piVar13 = (int *)0x0;
}
(**(code **)(*engine + 0x40))(engine,piVar13[0xc]);
(*pcVar3)(piVar11,"rescuer");
}
iVar8 = 0;
pcVar3 = *(code **)(*piVar11 + 0x30);
uVar7 = *(uint *)(this + 0x1920);
if (((uVar7 != 0xffffffff) &&
(puVar10 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar10 + 8) == uVar7 >> 0xc)) {
iVar8 = *(int *)(puVar10 + 4);
}
(**(code **)(*engine + 0x40))(engine,*(undefined4 *)(iVar8 + 0x30));
(*pcVar3)(piVar11,"victim");
(**(code **)(*piVar11 + 0x30))(piVar11,"dooridx");
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar11);
}
if (CVar1 != (CCSPlayer)0x0) {
uVar7 = *(uint *)(this + 0x1920);
iVar8 = 0;
if (((uVar7 != 0xffffffff) &&
(puVar10 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar10 + 8) == uVar7 >> 0xc)) {
iVar8 = *(int *)(puVar10 + 4);
}
lVar14 = (longdouble)CountdownTimer::Now();
if ((float)lVar14 + 1.0 != *(float *)(iVar8 + 0x3fd8)) {
(**(code **)(*(int *)(iVar8 + 0x3fd0) + 4))(iVar8 + 0x3fd0,iVar8 + 0x3fd8);
*(float *)(iVar8 + 0x3fd8) = (float)lVar14 + 1.0;
}
if (*(float *)(iVar8 + 0x3fd4) != 1.0) {
(**(code **)(*(int *)(iVar8 + 0x3fd0) + 4))(iVar8 + 0x3fd0,iVar8 + 0x3fd4);
*(undefined4 *)(iVar8 + 0x3fd4) = 0x3f800000;
}
}
CallForHelp(this,(CTerrorPlayer *)0x0);
*(int *)(this + 0x1934) = *(int *)(this + 0x1934) + 1;
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.