L L4D2node

CPointCommentaryNode::Spawn

0x0064ae80 · 496 bytes · __thiscall

_ZN20CPointCommentaryNode5SpawnEv

Decompiled

undefined (1 param)

/* CPointCommentaryNode::Spawn() */

void __thiscall CPointCommentaryNode::Spawn(CPointCommentaryNode *this)

{
  CBaseEdict *this_00;
  int iVar1;
  int iVar2;
  char *pcVar3;
  char *pcVar4;
  undefined1 local_4c [12];
  char *local_40 [3];
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  (**(code **)(*(int *)this + 0x20))(local_40,this);
  pcVar3 = local_40[0];
  if (local_40[0] == (char *)0x0) {
    pcVar3 = "";
  }
  if (*pcVar3 == '\0') {
    AllocPooledString((char *)local_40);
    *(char **)(this + 0x260) = local_40[0];
    CBaseEntity::DispatchUpdateTransmitState((CBaseEntity *)this);
    pcVar4 = "";
    if (local_40[0] != (char *)0x0) {
      pcVar4 = local_40[0];
    }
    pcVar3 = "models/extras/info_speech.mdl";
    iVar1 = (**(code **)(*soundemitterbase + 0x88))(soundemitterbase,pcVar4);
    if (iVar1 != *(int *)(this + 0xf4)) {
      if (this[0x6c] == (CPointCommentaryNode)0x0) {
        this_00 = *(CBaseEdict **)(this + 0x30);
        if (this_00 != (CBaseEdict *)0x0) {
          *(uint *)this_00 = *(uint *)this_00 | 0x101;
          iVar2 = CBaseEdict::GetChangeAccessor(this_00);
          *(undefined2 *)(iVar2 + 2) = 0;
        }
        *(int *)(this + 0xf4) = iVar1;
        pcVar3 = "models/extras/info_speech.mdl";
      }
      else {
        this[0x70] = (CPointCommentaryNode)((byte)this[0x70] | 1);
        *(int *)(this + 0xf4) = iVar1;
        pcVar3 = "models/extras/info_speech.mdl";
      }
    }
  }
  (**(code **)(*(int *)this + 0x6c))(this);
  (**(code **)(*(int *)this + 0x70))(this,pcVar3);
  local_28 = 0x41800000;
  local_24 = 0x41800000;
  local_20 = 0x41800000;
  local_34 = 0xc1800000;
  local_30 = 0xc1800000;
  local_2c = 0xc1800000;
  UTIL_SetSize((CBaseEntity *)this,(Vector *)&local_34,(Vector *)&local_28);
  CCollisionProperty::SetSolid((CCollisionProperty *)(this + 0x194),2);
  CCollisionProperty::SetSolidFlags
            ((CCollisionProperty *)(this + 0x194),(uint)(*(ushort *)(this + 0x1b4) | 3));
  CBaseEntity::AddEffects((CBaseEntity *)this,0x10);
  iVar1 = CBaseAnimating::LookupSequence((CBaseAnimating *)this,"idle");
  CBaseAnimating::ResetSequence((CBaseAnimating *)this,iVar1);
  CBaseEntity::ThinkSet((_func_void *)local_4c,(float)this,(char *)SpinThink);
  CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 0.1,(char *)0x0);
  SetDisabled(this,(bool)this[0x1449]);
  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)