L L4D2node

CC_Ent_RemoveAll

0x006002f0 · 332 bytes · __cdecl

_Z16CC_Ent_RemoveAllRK8CCommand

Decompiled

undefined (1 param)

/* CC_Ent_RemoveAll(CCommand const&) */

void CC_Ent_RemoveAll(CCommand *param_1)

{
  int iVar1;
  undefined1 *puVar2;
  char *pcVar3;
  char *pcVar4;
  CBaseEntity *pCVar5;
  int iVar6;
  
  if (*(int *)param_1 < 2) {
    Msg();
    return;
  }
  pCVar5 = (CBaseEntity *)0x0;
  iVar6 = 0;
  while( true ) {
    pCVar5 = (CBaseEntity *)CGlobalEntityList::NextEnt((CGlobalEntityList *)gEntList,pCVar5);
    if (pCVar5 == (CBaseEntity *)0x0) {
      if (iVar6 != 0) {
        if (*(int *)param_1 < 2) {
          puVar2 = &DAT_00d539c2;
        }
        else {
          puVar2 = *(undefined1 **)(param_1 + 0x40c);
        }
        Msg("Removed %d %s\'s\n",iVar6,puVar2);
        return;
      }
      puVar2 = &DAT_00d539c2;
      if (1 < *(int *)param_1) {
        puVar2 = *(undefined1 **)(param_1 + 0x40c);
      }
      Msg("No %s found.\n",puVar2);
      return;
    }
    pcVar4 = *(char **)(pCVar5 + 0x154);
    if (pcVar4 != (char *)0x0) break;
LAB_00600358:
    pcVar4 = *(char **)(pCVar5 + 0x7c);
    if (pcVar4 == (char *)0x0) {
LAB_006003d0:
      pcVar4 = "";
    }
    else {
      pcVar3 = "";
      if (1 < *(int *)param_1) {
        pcVar3 = *(char **)(param_1 + 0x40c);
      }
      if ((pcVar4 == pcVar3) || (iVar1 = _V_stricmp(pcVar3,pcVar4), iVar1 == 0)) goto LAB_006003b8;
      pcVar4 = *(char **)(pCVar5 + 0x7c);
      if (pcVar4 == (char *)0x0) goto LAB_006003d0;
    }
    pcVar3 = "";
    if (1 < *(int *)param_1) {
      pcVar3 = *(char **)(param_1 + 0x40c);
    }
    if ((pcVar4 == pcVar3) || (iVar1 = _V_stricmp(pcVar3,pcVar4), iVar1 == 0)) {
LAB_006003b8:
      iVar6 = iVar6 + 1;
      UTIL_Remove(pCVar5);
    }
  }
  pcVar3 = "";
  if (1 < *(int *)param_1) {
    pcVar3 = *(char **)(param_1 + 0x40c);
  }
  if ((pcVar4 != pcVar3) && (iVar1 = _V_stricmp(pcVar3,pcVar4), iVar1 != 0)) goto LAB_00600358;
  goto LAB_006003b8;
}

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)