L L4D2node

CTeamplayRoundBasedRules::CleanUpMap()::CTeamplayMapEntityFilter::CreateNextEntity

0x004c91b0 · 138 bytes · __thiscall

_ZZN24CTeamplayRoundBasedRules10CleanUpMapEvEN24CTeamplayMapEntityFilter16CreateNextEntityEPKc

Decompiled

undefined (2 params)

/* CreateNextEntity(char const*) */

undefined4 __thiscall
CTeamplayRoundBasedRules::CleanUpMap()::CTeamplayMapEntityFilter::CreateNextEntity
          (CTeamplayMapEntityFilter *this,char *param_1)

{
  uint *puVar1;
  uint uVar2;
  undefined4 uVar3;
  
  if (*(uint *)(this + 4) == 0xffff) {
    return 0;
  }
  puVar1 = (uint *)(g_MapEntityRefs + (*(uint *)(this + 4) & 0xffff) * 0xc);
  *(uint *)(this + 4) = (uint)*(ushort *)((int)puVar1 + 10);
  uVar2 = *puVar1;
  if ((uVar2 != 0xffffffff) &&
     (((0x7ff < uVar2 || (*(int *)(gpGlobals + 0x58) == 0)) ||
      ((*(byte *)(*(int *)(gpGlobals + 0x58) + uVar2 * 0x10) & 2) != 0)))) {
    uVar3 = CreateEntityByName(param_1,uVar2,true);
    return uVar3;
  }
  uVar3 = CreateEntityByName(param_1,-1,true);
  return uVar3;
}

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)