L L4D2node

InfoChangelevel::Spawn

0x00862da0 · 569 bytes · __thiscall

_ZN15InfoChangelevel5SpawnEv

Decompiled

undefined (1 param)

/* InfoChangelevel::Spawn() */

void __thiscall InfoChangelevel::Spawn(InfoChangelevel *this)

{
  InfoChangelevel *pIVar1;
  CBaseEdict *pCVar2;
  int iVar3;
  uint uVar4;
  InfoChangelevel *pIVar5;
  uint uVar6;
  float fVar7;
  undefined1 local_14 [8];
  
  pIVar1 = this + 0x569;
  if (pIVar1 != (InfoChangelevel *)&DAT_00d539c2) {
    iVar3 = _V_stricmp((char *)pIVar1,"");
    if (iVar3 != 0) {
      pIVar5 = *(InfoChangelevel **)(gpGlobals + 0x3c);
      if (pIVar5 == (InfoChangelevel *)0x0) {
        pIVar5 = (InfoChangelevel *)&DAT_00d539c2;
      }
      else if (pIVar1 == pIVar5) goto LAB_00862fb0;
      iVar3 = _V_stricmp((char *)pIVar1,(char *)pIVar5);
      if (iVar3 == 0) {
LAB_00862fb0:
        Msg("an info_changelevel points to the current map\n");
        UTIL_Remove((CBaseEntity *)this);
        return;
      }
      if (this + 0x589 == (InfoChangelevel *)&DAT_00d539c2) {
LAB_00862f90:
        Msg("info_changelevel to %s doesn\'t have a landmark\n",pIVar1);
        UTIL_Remove((CBaseEntity *)this);
        return;
      }
      iVar3 = _V_stricmp((char *)(this + 0x589),"");
      if (iVar3 == 0) goto LAB_00862f90;
      CBaseEntity::SetClassname((char *)this);
      CBaseTrigger::InitTrigger((CBaseTrigger *)this);
      uVar4 = *(uint *)(this + 0x148);
      if ((uVar4 & 2) == 0) {
        *(code **)(this + 0xd8) = TouchChangeLevel;
        *(undefined4 *)(this + 0xdc) = 0;
        uVar6 = uVar4 | 1;
        if (uVar4 != uVar6) {
          if (this[0x6c] == (InfoChangelevel)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] = (InfoChangelevel)((byte)this[0x70] | 1);
          }
          *(uint *)(this + 0x148) = uVar6;
          uVar4 = uVar6;
        }
        if ((uVar4 | 0x40) != uVar4) {
          if (this[0x6c] == (InfoChangelevel)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] = (InfoChangelevel)((byte)this[0x70] | 1);
          }
          *(uint *)(this + 0x148) = uVar4 | 0x40;
        }
        CBaseEntity::ThinkSet((_func_void *)local_14,(float)this,(char *)ChangelevelThink);
        fVar7 = 0.0;
        if (*(int *)(this + 0x30) != 0) {
          fVar7 = (float)((*(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4) % 10) * 0.1;
        }
        CBaseEntity::SetNextThink
                  ((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 10.0 + fVar7,(char *)0x0);
        return;
      }
      goto LAB_00862f7c;
    }
  }
  Msg("an info_changelevel doesn\'t have a map\n");
LAB_00862f7c:
  UTIL_Remove((CBaseEntity *)this);
  return;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)