CWeaponSpawn::ModifyWeaponSpawns
0x008d7770 · 599 bytes · __thiscall
_ZN12CWeaponSpawn18ModifyWeaponSpawnsEv
Decompiled
undefined (1 param)
/* CWeaponSpawn::ModifyWeaponSpawns() */
undefined1 __thiscall CWeaponSpawn::ModifyWeaponSpawns(CWeaponSpawn *this)
{
CBaseEdict *this_00;
char cVar1;
int iVar2;
undefined4 uVar3;
char *pcVar4;
CBaseEntity *this_01;
int iVar5;
undefined1 uVar6;
uint uVar7;
char *pcVar8;
int in_GS_OFFSET;
char local_60 [64];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if ((this[0x1464] == (CWeaponSpawn)0x0) &&
(iVar2 = (**(code **)(*(int *)this + 0x3cc))(this), iVar2 != 0)) {
uVar6 = 0;
if (((byte)this[0x148] & 8) == 0) {
uVar3 = (**(code **)(*(int *)this + 0x3cc))(this);
cVar1 = CTerrorGameRules::IsScavengeMode();
if ((cVar1 == '\0') || (iVar2 = (**(code **)(*(int *)this + 0x3d0))(this), iVar2 == 0)) {
pcVar8 = local_60;
cVar1 = CDirectorChallengeMode::ConvertWeaponSpawn
(*(CDirectorChallengeMode **)(TheDirector + 0x648),uVar3,pcVar8,0x40);
if (cVar1 == '\0') goto LAB_008d7796;
}
else {
pcVar4 = (char *)(**(code **)(*(int *)this + 0x3d4))(this);
pcVar8 = local_60;
cVar1 = CDirectorChallengeMode::ConvertWeaponSpawn
(*(CDirectorChallengeMode **)(TheDirector + 0x648),iVar2,pcVar8,0x40);
if ((cVar1 == '\0') && (pcVar8 = pcVar4, pcVar4 == (char *)0x0)) goto LAB_008d7796;
}
this_01 = (CBaseEntity *)CreateEntityByName(pcVar8,-1,true);
if (this_01 != (CBaseEntity *)0x0) {
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
CBaseEntity::SetAbsOrigin(this_01,(Vector *)(this + 0x2e0));
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
CBaseEntity::SetAbsAngles(this_01,(QAngle *)(this + 0x37c));
*(undefined4 *)(this_01 + 0x154) = *(undefined4 *)(this + 0x154);
uVar7 = *(uint *)(this + 0x148) | *(uint *)(this_01 + 0x148);
if (*(uint *)(this_01 + 0x148) != uVar7) {
if (this_01[0x6c] == (CBaseEntity)0x0) {
this_00 = *(CBaseEdict **)(this_01 + 0x30);
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar2 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar2 + 2) = 0;
}
}
else {
this_01[0x70] = (CBaseEntity)((byte)this_01[0x70] | 1);
}
*(uint *)(this_01 + 0x148) = uVar7;
}
CBaseEntity::AddEffects(this_01,*(int *)(this + 0xd4));
iVar2 = __dynamic_cast(this_01,&CBaseEntity::typeinfo,&typeinfo,0);
if (iVar2 != 0) {
iVar5 = *(int *)(this + 0x144c);
*(undefined1 *)(iVar2 + 0x1464) = 1;
if (iVar5 == 0) {
iVar5 = 1;
}
*(int *)(iVar2 + 0x144c) = iVar5;
}
uVar6 = 1;
(**(code **)(*(int *)this_01 + 0x6c))(this_01);
DispatchSpawn(this_01,true);
UTIL_Remove((CBaseEntity *)this);
}
}
}
else {
uVar6 = 0;
}
LAB_008d7796:
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
return uVar6;
}
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.