CChangeLevel::Spawn
0x00b1eea0 · 455 bytes · __thiscall
_ZN12CChangeLevel5SpawnEv
Decompiled
undefined (1 param)
/* CChangeLevel::Spawn() */
void __thiscall CChangeLevel::Spawn(CChangeLevel *this)
{
CChangeLevel *pCVar1;
CBaseEdict *pCVar2;
int iVar3;
uint uVar4;
uint uVar5;
float fVar6;
undefined1 local_14 [8];
pCVar1 = this + 0x569;
if (pCVar1 == (CChangeLevel *)&DAT_00d539c2) {
LAB_00b1f048:
Msg("a info_changelevel doesn\'t have a map");
}
else {
iVar3 = _V_stricmp((char *)pCVar1,"");
if (iVar3 == 0) goto LAB_00b1f048;
}
if (this + 0x589 != (CChangeLevel *)&DAT_00d539c2) {
iVar3 = _V_stricmp((char *)(this + 0x589),"");
if (iVar3 != 0) goto LAB_00b1eefe;
}
Msg("info_changelevel to %s doesn\'t have a landmark",pCVar1);
LAB_00b1eefe:
CBaseTrigger::InitTrigger((CBaseTrigger *)this);
uVar4 = *(uint *)(this + 0x148);
if ((uVar4 & 2) == 0) {
*(code **)(this + 0xd8) = TouchChangeLevel;
*(undefined4 *)(this + 0xdc) = 0;
uVar5 = uVar4 | 1;
if (uVar4 != uVar5) {
if (this[0x6c] == (CChangeLevel)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
this[0x70] = (CChangeLevel)((byte)this[0x70] | 1);
}
*(uint *)(this + 0x148) = uVar5;
uVar4 = uVar5;
}
if ((uVar4 | 0x40) != uVar4) {
if (this[0x6c] == (CChangeLevel)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
this[0x70] = (CChangeLevel)((byte)this[0x70] | 1);
}
*(uint *)(this + 0x148) = uVar4 | 0x40;
}
CBaseEntity::ThinkSet((_func_void *)local_14,(float)this,(char *)ChangelevelThink);
fVar6 = 0.0;
if (*(int *)(this + 0x30) != 0) {
fVar6 = (float)((*(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4) % 10) * 0.1;
}
CBaseEntity::SetNextThink
((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 10.0 + fVar6,(char *)0x0);
}
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.