L L4D2node

CChangeLevel::AddTransitionToList

0x00b18c20 · 305 bytes · __cdecl

_ZN12CChangeLevel19AddTransitionToListEP11levellist_tiPKcS3_P7edict_t

Decompiled

undefined (5 params)

/* CChangeLevel::AddTransitionToList(levellist_t*, int, char const*, char const*, edict_t*) */

undefined4
CChangeLevel::AddTransitionToList
          (levellist_t *param_1,int param_2,char *param_3,char *param_4,edict_t *param_5)

{
  int *piVar1;
  char *pcVar2;
  int iVar3;
  int iVar4;
  CBaseEntity *this;
  levellist_t *plVar5;
  
  if ((((param_1 != (levellist_t *)0x0) && (param_3 != (char *)0x0)) && (param_4 != (char *)0x0)) &&
     (param_5 != (edict_t *)0x0)) {
    pcVar2 = "";
    if (*(char **)(gpGlobals + 0x3c) != (char *)0x0) {
      pcVar2 = *(char **)(gpGlobals + 0x3c);
    }
    iVar3 = _V_stricmp(param_3,pcVar2);
    if (iVar3 != 0) {
      if (0 < param_2) {
        iVar3 = 0;
        plVar5 = param_1;
        do {
          if ((*(edict_t **)(plVar5 + 0x40) == param_5) &&
             (iVar4 = _V_stricmp((char *)plVar5,param_3), iVar4 == 0)) {
            return 0;
          }
          iVar3 = iVar3 + 1;
          plVar5 = plVar5 + 0x50;
        } while (iVar3 != param_2);
      }
      plVar5 = param_1 + param_2 * 0x50;
      V_strncpy((char *)plVar5,param_3,0x20);
      V_strncpy((char *)(plVar5 + 0x20),param_4,0x20);
      *(edict_t **)(plVar5 + 0x40) = param_5;
      piVar1 = *(int **)(param_5 + 0xc);
      if (piVar1 == (int *)0x0) {
        this = (CBaseEntity *)0x0;
      }
      else {
        this = (CBaseEntity *)(**(code **)(*piVar1 + 0x18))(piVar1);
      }
      if (((byte)this[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(this);
      }
      *(undefined4 *)(plVar5 + 0x44) = *(undefined4 *)(this + 0x2e0);
      *(undefined4 *)(plVar5 + 0x48) = *(undefined4 *)(this + 0x2e4);
      *(undefined4 *)(plVar5 + 0x4c) = *(undefined4 *)(this + 0x2e8);
      return 1;
    }
  }
  return 0;
}

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)