CCommentaryZombieSpawner::InputSpawnZombie
0x003e1750 · 1263 bytes · __thiscall
_ZN24CCommentaryZombieSpawner16InputSpawnZombieER11inputdata_t
Decompiled
undefined (2 params)
/* CCommentaryZombieSpawner::InputSpawnZombie(inputdata_t&) */
void __thiscall
CCommentaryZombieSpawner::InputSpawnZombie(CCommentaryZombieSpawner *this,inputdata_t *param_1)
{
char *pcVar1;
code *pcVar2;
int iVar3;
char cVar4;
char *pcVar5;
int iVar6;
int *piVar7;
undefined1 *puVar8;
int in_GS_OFFSET;
undefined4 uStack_160;
int iStack_158;
size_t asStack_154 [4];
int *local_144;
int local_140 [2];
undefined4 local_138;
undefined4 local_134;
undefined4 local_130;
undefined4 local_12c;
undefined4 local_128;
undefined4 local_124;
undefined1 local_120 [256];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (*(int *)(param_1 + 0x18) == 2) {
pcVar5 = "";
if (*(char **)(param_1 + 8) != (char *)0x0) {
pcVar5 = *(char **)(param_1 + 8);
}
}
else {
uStack_160 = 0x3e1783;
pcVar5 = (char *)variant_t::ToString((variant_t *)(param_1 + 8));
puVar8 = &stack0xfffffea4;
if (pcVar5 == (char *)0x0) goto LAB_003e18ae;
}
puVar8 = &stack0xfffffea4;
if (*pcVar5 == '\0') goto LAB_003e18ae;
uStack_160 = 0x3e179e;
iVar6 = _V_strlen(pcVar5);
iVar3 = -((iVar6 + 0x10U & 0xfffffff0) + 0x10);
puVar8 = (undefined1 *)((int)local_140 + iVar3 + -0x1c);
pcVar1 = (char *)((int)local_140 + iVar3);
*(char **)((int)&iStack_158 + iVar3) = pcVar5;
*(int *)((int)asStack_154 + iVar3) = iVar6 + 1;
*(char **)((int)local_140 + iVar3 + -0x1c) = pcVar1;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e17c5;
memcpy(*(void **)((int)local_140 + iVar3 + -0x1c),*(void **)((int)&iStack_158 + iVar3),
*(size_t *)((int)asStack_154 + iVar3));
cVar4 = *pcVar1;
pcVar5 = pcVar1;
if (cVar4 != '\0') {
if ((cVar4 != ' ') && (cVar4 != ',')) {
while (cVar4 != ';') {
pcVar5 = pcVar5 + 1;
cVar4 = *pcVar5;
if (cVar4 == '\0') goto LAB_003e17e6;
if ((cVar4 == ',') || (cVar4 == ' ')) break;
}
}
*pcVar5 = '\0';
pcVar5 = pcVar5 + 1;
}
LAB_003e17e6:
if (((byte)this[0x14d] & 8) == 0) {
local_138 = *(undefined4 *)(this + 0x2e0);
local_134 = *(undefined4 *)(this + 0x2e4);
local_130 = *(undefined4 *)(this + 0x2e8);
local_12c = vec3_angle;
local_124 = DAT_01053d44;
}
else {
*(CCommentaryZombieSpawner **)((int)local_140 + iVar3 + -0x1c) = this;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e1920;
CBaseEntity::CalcAbsolutePosition(*(CBaseEntity **)((int)local_140 + iVar3 + -0x1c));
local_138 = *(undefined4 *)(this + 0x2e0);
local_134 = *(undefined4 *)(this + 0x2e4);
local_130 = *(undefined4 *)(this + 0x2e8);
local_12c = vec3_angle;
local_128 = DAT_01053d40;
local_124 = DAT_01053d44;
if ((*(uint *)(this + 0x14c) & 0x800) != 0) {
*(CCommentaryZombieSpawner **)((int)local_140 + iVar3 + -0x1c) = this;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e197d;
CBaseEntity::CalcAbsolutePosition(*(CBaseEntity **)((int)local_140 + iVar3 + -0x1c));
}
}
local_128 = *(undefined4 *)(this + 0x380);
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e184d;
EnableManualSpawnOverride();
*(char **)((int)&iStack_158 + iVar3) = "boomer";
*(char **)((int)local_140 + iVar3 + -0x1c) = pcVar1;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e185d;
iVar6 = _V_stricmp(*(char **)((int)local_140 + iVar3 + -0x1c),*(char **)((int)&iStack_158 + iVar3)
);
if (iVar6 == 0) {
*(undefined4 *)((int)&iStack_158 + iVar3) = 2;
*(undefined4 **)((int)asStack_154 + iVar3 + 4) = &local_12c;
*(undefined4 **)((int)asStack_154 + iVar3) = &local_138;
*(undefined4 *)((int)local_140 + iVar3 + -0x1c) = TheZombieManager;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e188e;
piVar7 = (int *)ZombieManager::SpawnSpecial();
LAB_003e1890:
if (piVar7 != (int *)0x0) {
LAB_003e1894:
if (*pcVar5 != '\0') {
*(char **)((int)&iStack_158 + iVar3) = pcVar5;
*(int **)((int)local_140 + iVar3 + -0x1c) = local_140;
local_144 = piVar7;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e19e8;
AllocPooledString(*(char **)((int)local_140 + iVar3 + -0x1c));
local_144[0x55] = local_140[0];
piVar7 = local_144;
}
iVar6 = *piVar7;
*(CCommentaryZombieSpawner **)((int)&iStack_158 + iVar3) = this;
*(int **)((int)local_140 + iVar3 + -0x1c) = piVar7;
pcVar2 = *(code **)(iVar6 + 0x50);
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e18a9;
(*pcVar2)();
}
}
else {
*(char **)((int)&iStack_158 + iVar3) = "charger";
*(char **)((int)local_140 + iVar3 + -0x1c) = pcVar1;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e1998;
iVar6 = _V_stricmp(*(char **)((int)local_140 + iVar3 + -0x1c),
*(char **)((int)&iStack_158 + iVar3));
if (iVar6 == 0) {
*(undefined4 *)((int)&iStack_158 + iVar3) = 6;
*(undefined4 **)((int)asStack_154 + iVar3 + 4) = &local_12c;
*(undefined4 **)((int)asStack_154 + iVar3) = &local_138;
*(undefined4 *)((int)local_140 + iVar3 + -0x1c) = TheZombieManager;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e19c5;
piVar7 = (int *)ZombieManager::SpawnSpecial();
goto LAB_003e1890;
}
*(char **)((int)&iStack_158 + iVar3) = "hunter";
*(char **)((int)local_140 + iVar3 + -0x1c) = pcVar1;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e1a18;
iVar6 = _V_stricmp(*(char **)((int)local_140 + iVar3 + -0x1c),
*(char **)((int)&iStack_158 + iVar3));
if (iVar6 == 0) {
*(undefined4 *)((int)&iStack_158 + iVar3) = 3;
*(undefined4 **)((int)asStack_154 + iVar3 + 4) = &local_12c;
*(undefined4 **)((int)asStack_154 + iVar3) = &local_138;
*(undefined4 *)((int)local_140 + iVar3 + -0x1c) = TheZombieManager;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e1a89;
piVar7 = (int *)ZombieManager::SpawnSpecial();
goto LAB_003e1890;
}
*(char **)((int)&iStack_158 + iVar3) = "jockey";
*(char **)((int)local_140 + iVar3 + -0x1c) = pcVar1;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e1a2c;
iVar6 = _V_stricmp(*(char **)((int)local_140 + iVar3 + -0x1c),
*(char **)((int)&iStack_158 + iVar3));
if (iVar6 == 0) {
*(undefined4 *)((int)&iStack_158 + iVar3) = 5;
*(undefined4 **)((int)asStack_154 + iVar3 + 4) = &local_12c;
*(undefined4 **)((int)asStack_154 + iVar3) = &local_138;
*(undefined4 *)((int)local_140 + iVar3 + -0x1c) = TheZombieManager;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e1a59;
piVar7 = (int *)ZombieManager::SpawnSpecial();
goto LAB_003e1890;
}
*(char **)((int)&iStack_158 + iVar3) = "smoker";
*(char **)((int)local_140 + iVar3 + -0x1c) = pcVar1;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e1aa0;
iVar6 = _V_stricmp(*(char **)((int)local_140 + iVar3 + -0x1c),
*(char **)((int)&iStack_158 + iVar3));
if (iVar6 == 0) {
*(undefined4 *)((int)&iStack_158 + iVar3) = 1;
*(undefined4 **)((int)asStack_154 + iVar3 + 4) = &local_12c;
*(undefined4 **)((int)asStack_154 + iVar3) = &local_138;
*(undefined4 *)((int)local_140 + iVar3 + -0x1c) = TheZombieManager;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e1acd;
piVar7 = (int *)ZombieManager::SpawnSpecial();
goto LAB_003e1890;
}
*(char **)((int)&iStack_158 + iVar3) = "spitter";
*(char **)((int)local_140 + iVar3 + -0x1c) = pcVar1;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e1ae4;
iVar6 = _V_stricmp(*(char **)((int)local_140 + iVar3 + -0x1c),
*(char **)((int)&iStack_158 + iVar3));
if (iVar6 == 0) {
*(undefined4 *)((int)&iStack_158 + iVar3) = 4;
*(undefined4 **)((int)asStack_154 + iVar3 + 4) = &local_12c;
*(undefined4 **)((int)asStack_154 + iVar3) = &local_138;
*(undefined4 *)((int)local_140 + iVar3 + -0x1c) = TheZombieManager;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e1b11;
piVar7 = (int *)ZombieManager::SpawnSpecial();
goto LAB_003e1890;
}
*(char **)((int)&iStack_158 + iVar3) = "tank";
*(char **)((int)local_140 + iVar3 + -0x1c) = pcVar1;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e1b28;
iVar6 = _V_stricmp(*(char **)((int)local_140 + iVar3 + -0x1c),
*(char **)((int)&iStack_158 + iVar3));
if (iVar6 == 0) {
*(undefined4 **)((int)asStack_154 + iVar3) = &local_12c;
*(undefined4 **)((int)&iStack_158 + iVar3) = &local_138;
*(undefined4 *)((int)local_140 + iVar3 + -0x1c) = TheZombieManager;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e1b4d;
piVar7 = (int *)ZombieManager::SpawnTank
(*(ZombieManager **)((int)local_140 + iVar3 + -0x1c),
*(Vector **)((int)&iStack_158 + iVar3),
*(QAngle **)((int)asStack_154 + iVar3));
goto LAB_003e1890;
}
*(char **)((int)&iStack_158 + iVar3) = "witch";
*(char **)((int)local_140 + iVar3 + -0x1c) = pcVar1;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e1b64;
iVar6 = _V_stricmp(*(char **)((int)local_140 + iVar3 + -0x1c),
*(char **)((int)&iStack_158 + iVar3));
if (iVar6 == 0) {
*(undefined4 **)((int)asStack_154 + iVar3) = &local_12c;
*(undefined4 **)((int)&iStack_158 + iVar3) = &local_138;
*(undefined4 *)((int)local_140 + iVar3 + -0x1c) = TheZombieManager;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e1b89;
piVar7 = (int *)ZombieManager::SpawnWitch
(*(ZombieManager **)((int)local_140 + iVar3 + -0x1c),
*(Vector **)((int)&iStack_158 + iVar3),
*(QAngle **)((int)asStack_154 + iVar3));
goto LAB_003e1890;
}
*(undefined4 *)((int)asStack_154 + iVar3) = 7;
*(char **)((int)&iStack_158 + iVar3) = "common_";
*(char **)((int)local_140 + iVar3 + -0x1c) = pcVar1;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e1ba8;
iVar6 = V_strnicmp(*(char **)((int)local_140 + iVar3 + -0x1c),
*(char **)((int)&iStack_158 + iVar3),*(int *)((int)asStack_154 + iVar3));
if (iVar6 == 0) {
*(undefined4 *)((int)asStack_154 + iVar3) = 1;
*(undefined4 *)((int)&iStack_158 + iVar3) = 0xffffffff;
*(char **)((int)local_140 + iVar3 + -0x1c) = "infected";
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e1bcc;
piVar7 = (int *)CreateEntityByName(*(char **)((int)local_140 + iVar3 + -0x1c),
*(int *)((int)&iStack_158 + iVar3),
*(bool *)((int)asStack_154 + iVar3));
if (piVar7 == (int *)0x0) goto LAB_003e18a9;
*(int **)((int)local_140 + iVar3 + -0x1c) = piVar7;
*(undefined4 **)((int)&iStack_158 + iVar3) = &local_12c;
local_144 = piVar7;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e1bee;
CBaseEntity::SetAbsAngles
(*(CBaseEntity **)((int)local_140 + iVar3 + -0x1c),
*(QAngle **)((int)&iStack_158 + iVar3));
piVar7 = local_144;
*(undefined4 **)((int)&iStack_158 + iVar3) = &local_138;
*(int **)((int)local_140 + iVar3 + -0x1c) = piVar7;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e1c06;
CBaseEntity::SetAbsOrigin
(*(CBaseEntity **)((int)local_140 + iVar3 + -0x1c),
*(Vector **)((int)&iStack_158 + iVar3));
*(char **)((int)asStack_154 + iVar3 + 4) = pcVar1;
*(char **)((int)asStack_154 + iVar3) = "models/infected/%s.mdl";
*(undefined4 *)((int)&iStack_158 + iVar3) = 0x100;
*(undefined1 **)((int)local_140 + iVar3 + -0x1c) = local_120;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e1c28;
V_snprintf(*(char **)((int)local_140 + iVar3 + -0x1c),*(int *)((int)&iStack_158 + iVar3),
*(char **)((int)asStack_154 + iVar3));
*(undefined1 **)((int)local_140 + iVar3 + -0x1c) = local_120;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e1c30;
CBaseEntity::PrecacheModel(*(char **)((int)local_140 + iVar3 + -0x1c));
iVar6 = *local_144;
*(int **)((int)local_140 + iVar3 + -0x1c) = local_144;
*(undefined1 **)((int)&iStack_158 + iVar3) = local_120;
pcVar2 = *(code **)(iVar6 + 0x70);
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e1c42;
(*pcVar2)();
piVar7 = local_144;
*(undefined4 *)((int)&iStack_158 + iVar3) = 1;
*(int **)((int)local_140 + iVar3 + -0x1c) = piVar7;
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e1c58;
DispatchSpawn(*(CBaseEntity **)((int)local_140 + iVar3 + -0x1c),
*(bool *)((int)&iStack_158 + iVar3));
piVar7 = local_144;
goto LAB_003e1894;
}
}
LAB_003e18a9:
*(undefined4 *)((int)&uStack_160 + iVar3) = 0x3e18ae;
DisableManualSpawnOverride();
LAB_003e18ae:
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
*(undefined **)(puVar8 + -4) = &UNK_003e1c68;
__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.