L L4D2node

CC_Ent_Remove

0x00608570 · 454 bytes · __cdecl

_Z13CC_Ent_RemoveRK8CCommand

Decompiled

undefined (1 param)

/* CC_Ent_Remove(CCommand const&) */

void CC_Ent_Remove(CCommand *param_1)

{
  byte *pbVar1;
  int *piVar2;
  int iVar3;
  char *pcVar4;
  uint uVar5;
  undefined4 uVar6;
  CBasePlayer *pCVar7;
  byte *pbVar8;
  char *pcVar9;
  undefined1 *puVar10;
  CBaseEntity *this;
  
  if (((*(int *)param_1 < 2) || (*(char **)(param_1 + 0x40c) == "")) ||
     (iVar3 = _V_stricmp(*(char **)(param_1 + 0x40c),""), iVar3 == 0)) {
    pCVar7 = (CBasePlayer *)UTIL_GetCommandClient();
    this = (CBaseEntity *)FindPickerEntity(pCVar7);
    goto LAB_006086df;
  }
  pcVar4 = "";
  if (1 < *(int *)param_1) {
    pcVar4 = *(char **)(param_1 + 0x40c);
  }
  this = (CBaseEntity *)0x0;
  uVar5 = strtol(pcVar4,(char **)0x0,10);
  if (uVar5 == 0) {
    do {
      this = (CBaseEntity *)CGlobalEntityList::NextEnt((CGlobalEntityList *)gEntList,this);
      if (this == (CBaseEntity *)0x0) {
        return;
      }
      pcVar4 = *(char **)(this + 0x154);
      if (pcVar4 != (char *)0x0) {
        pcVar9 = "";
        if (1 < *(int *)param_1) {
          pcVar9 = *(char **)(param_1 + 0x40c);
        }
        if ((pcVar4 == pcVar9) || (iVar3 = _V_stricmp(pcVar9,pcVar4), iVar3 == 0))
        goto LAB_00608690;
      }
      pcVar4 = *(char **)(this + 0x7c);
      if (pcVar4 == (char *)0x0) {
LAB_006086f0:
        pcVar4 = "";
      }
      else {
        pcVar9 = "";
        if (1 < *(int *)param_1) {
          pcVar9 = *(char **)(param_1 + 0x40c);
        }
        if ((pcVar4 == pcVar9) || (iVar3 = _V_stricmp(pcVar9,pcVar4), iVar3 == 0))
        goto LAB_00608690;
        pcVar4 = *(char **)(this + 0x7c);
        if (pcVar4 == (char *)0x0) goto LAB_006086f0;
      }
      pcVar9 = "";
      if (1 < *(int *)param_1) {
        pcVar9 = *(char **)(param_1 + 0x40c);
      }
      if ((pcVar4 == pcVar9) || (iVar3 = _V_stricmp(pcVar9,pcVar4), iVar3 == 0)) goto LAB_00608690;
    } while( true );
  }
  if (uVar5 < 0x800) {
    pbVar1 = *(byte **)(gpGlobals + 0x58);
    if (pbVar1 == (byte *)0x0) {
      return;
    }
    pbVar8 = pbVar1 + uVar5 * 0x10;
    if ((*pbVar8 & 2) != 0) goto LAB_0060873d;
  }
  else {
    pbVar1 = *(byte **)(gpGlobals + 0x58);
    if (*(byte **)(gpGlobals + 0x58) == (byte *)0x0) {
      return;
    }
LAB_0060873d:
    pbVar8 = pbVar1;
    if ((*pbVar8 & 2) != 0) {
      return;
    }
  }
  piVar2 = *(int **)(pbVar8 + 0xc);
  if (piVar2 == (int *)0x0) {
    return;
  }
  this = (CBaseEntity *)(**(code **)(*piVar2 + 0x18))(piVar2);
LAB_006086df:
  if (this == (CBaseEntity *)0x0) {
    return;
  }
LAB_00608690:
  uVar6 = CBaseEntity::GetDebugName(this);
  puVar10 = &DAT_00d539c2;
  if (*(undefined1 **)(this + 0x7c) != (undefined1 *)0x0) {
    puVar10 = *(undefined1 **)(this + 0x7c);
  }
  Msg("Removed %s(%s)\n",puVar10,uVar6);
  UTIL_Remove(this);
  return;
}

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)