L L4D2node

CreateEntitiesInTransitionList

0x004ab6d0 · 385 bytes · __cdecl

_Z30CreateEntitiesInTransitionListP16CSaveRestoreDatai

Decompiled

undefined (2 params)

/* CreateEntitiesInTransitionList(CSaveRestoreData*, int) */

void CreateEntitiesInTransitionList(CSaveRestoreData *param_1,int param_2)

{
  uint uVar1;
  int *piVar2;
  undefined4 *puVar3;
  edict_t *peVar4;
  char *pcVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  bool bVar9;
  
  if (*(int *)(param_1 + 0x574) < 1) {
    return;
  }
  iVar8 = 0;
  iVar7 = 0;
LAB_004ab6f8:
  do {
    while( true ) {
      iVar6 = *(int *)(param_1 + 0x578) + iVar8;
      *(undefined4 *)(iVar6 + 0x10) = 0xffffffff;
      if ((*(int *)(iVar6 + 0x18) != 0) && (uVar1 = *(uint *)(iVar6 + 4), uVar1 != 0)) break;
LAB_004ab788:
      iVar7 = iVar7 + 1;
      iVar8 = iVar8 + 0x38;
      if (*(int *)(param_1 + 0x574) <= iVar7) {
        return;
      }
    }
    pcVar5 = *(char **)(iVar6 + 0x20);
    if (pcVar5 == (char *)0x0) {
      iVar7 = iVar7 + 1;
      iVar8 = iVar8 + 0x38;
      Warning("Entity with data saved, but with no classname\n");
      if (*(int *)(param_1 + 0x574) <= iVar7) {
        return;
      }
      goto LAB_004ab6f8;
    }
    bVar9 = (param_2 & *(uint *)(iVar6 + 0x1c)) != 0;
    if (((int)uVar1 < 1) || (*(int *)(gpGlobals + 0x14) < (int)uVar1)) {
      if (bVar9) {
        piVar2 = (int *)CreateEntityByName(pcVar5,-1,true);
        goto LAB_004ab76a;
      }
    }
    else if ((((uVar1 < 0x800) && (*(int *)(gpGlobals + 0x58) != 0)) &&
             (peVar4 = (edict_t *)(uVar1 * 0x10 + *(int *)(gpGlobals + 0x58)),
             ((byte)*peVar4 & 2) == 0)) && (bVar9)) {
      if (-1 < (int)*(uint *)(iVar6 + 0x1c)) {
        Warning("ENTITY IS NOT A PLAYER: %d\n",iVar7);
        pcVar5 = *(char **)(iVar6 + 0x20);
        if (pcVar5 == (char *)0x0) {
          pcVar5 = "";
        }
      }
      piVar2 = (int *)CBasePlayer::CreatePlayer(pcVar5,peVar4);
LAB_004ab76a:
      if (piVar2 != (int *)0x0) {
        puVar3 = (undefined4 *)(**(code **)(*piVar2 + 0xc))(piVar2);
        *(undefined4 *)(iVar6 + 0x10) = *puVar3;
        goto LAB_004ab788;
      }
    }
    *(undefined4 *)(iVar6 + 0x10) = 0xffffffff;
    iVar7 = iVar7 + 1;
    iVar8 = iVar8 + 0x38;
    if (*(int *)(param_1 + 0x574) <= iVar7) {
      return;
    }
  } while( true );
}

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)