L L4D2node

CBaseEntity::AddContext

0x006159d0 · 388 bytes · __thiscall

_ZN11CBaseEntity10AddContextEPKc

Decompiled

undefined (2 params)

/* CBaseEntity::AddContext(char const*) */

void __thiscall CBaseEntity::AddContext(CBaseEntity *this,char *param_1)

{
  byte *pbVar1;
  int *piVar2;
  char *pcVar3;
  int in_GS_OFFSET;
  CBaseEntity *local_138;
  float local_124;
  char local_120;
  char local_11f [127];
  char local_a0 [128];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  pbVar1 = *(byte **)(gpGlobals + 0x58);
  if (((pbVar1 == (byte *)0x0) || ((*pbVar1 & 2) != 0)) ||
     (piVar2 = *(int **)(pbVar1 + 0xc), piVar2 == (int *)0x0)) {
    local_138 = (CBaseEntity *)0x0;
  }
  else {
    local_138 = (CBaseEntity *)(**(code **)(*piVar2 + 0x18))(piVar2);
  }
  if (param_1 != (char *)0x0) {
    pcVar3 = param_1;
    do {
      while( true ) {
        local_124 = 0.0;
        pcVar3 = (char *)SplitContext(pcVar3,&local_120,0x80,local_a0,0x80,&local_124,param_1);
        if (local_124 != 0.0) {
          local_124 = local_124 + *(float *)(gpGlobals + 0xc);
        }
        if (((local_120 != '$') || (local_138 == (CBaseEntity *)0x0)) || (this == local_138)) break;
        AddContext(local_138,local_11f,local_a0,local_124);
        if (pcVar3 == (char *)0x0) goto LAB_00615b30;
      }
      AddContext(this,&local_120,local_a0,local_124);
    } while (pcVar3 != (char *)0x0);
  }
LAB_00615b30:
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  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)