L L4D2node

CChangeLevel::BuildEntityTransitionList

0x00b21d90 · 315 bytes · __cdecl

_ZN12CChangeLevel25BuildEntityTransitionListEP11CBaseEntityPKcPS1_Pii

Decompiled

undefined (5 params)

/* CChangeLevel::BuildEntityTransitionList(CBaseEntity*, char const*, CBaseEntity**, int*, int) */

int CChangeLevel::BuildEntityTransitionList
              (CBaseEntity *param_1,char *param_2,CBaseEntity **param_3,int *param_4,int param_5)

{
  char cVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  undefined1 *puVar5;
  int iVar6;
  CBaseEntity *this;
  
  iVar6 = *(int *)(g_debug_transitions._28_4_ + 0x30);
  if (iVar6 == 0) {
LAB_00b21dd0:
    g_iDebuggingTransition = 0;
  }
  else {
    if (*(undefined1 **)(param_1 + 0x154) != st_szNextSpot) {
      cVar1 = CBaseEntity::NameMatchesComplex(param_1,st_szNextSpot);
      if (cVar1 == '\0') goto LAB_00b21dd0;
      iVar6 = *(int *)(g_debug_transitions._28_4_ + 0x30);
    }
    *(uint *)(param_1 + 0x110) = *(uint *)(param_1 + 0x110) | 0xe;
    g_iDebuggingTransition = iVar6;
  }
  this = (CBaseEntity *)0x0;
  iVar6 = 0;
  while( true ) {
    while( true ) {
      do {
        this = (CBaseEntity *)UTIL_EntitiesInPVS(param_1,this);
        if (this == (CBaseEntity *)0x0) {
          return iVar6;
        }
        iVar2 = ComputeEntitySaveFlags(this);
      } while (iVar2 == 0);
      iVar3 = InTransitionVolume(this,param_2);
      if (iVar3 != 0) break;
      if (g_iDebuggingTransition == 2) {
        Msg("IGNORED, outside transition volume.\n");
      }
    }
    if (param_5 <= iVar6) break;
    param_3[iVar6] = this;
    param_4[iVar6] = iVar2;
    iVar6 = iVar6 + 1;
    if (g_iDebuggingTransition != 0) {
      if (g_iDebuggingTransition == 2) {
        Msg("ADDED.\n");
      }
      else {
        uVar4 = CBaseEntity::GetDebugName(this);
        puVar5 = *(undefined1 **)(this + 0x7c);
        if (puVar5 == (undefined1 *)0x0) {
          puVar5 = &DAT_00d539c2;
        }
        Msg("ADDED %s (%s) to transition.\n",puVar5,uVar4);
      }
      *(uint *)(this + 0x110) = *(uint *)(this + 0x110) | 6;
    }
  }
  Warning("Too many entities across a transition!\n");
  return iVar6;
}

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)