L L4D2node

CPointCommentaryNode::Activate

0x0064bcb0 · 745 bytes · __thiscall

_ZN20CPointCommentaryNode8ActivateEv

Decompiled

undefined (1 param)

/* CPointCommentaryNode::Activate() */

void __thiscall CPointCommentaryNode::Activate(CPointCommentaryNode *this)

{
  undefined *puVar1;
  CBaseEdict *pCVar2;
  int iVar3;
  int *piVar4;
  uint *puVar5;
  undefined1 *puVar6;
  undefined4 uVar7;
  uint uVar8;
  undefined *puVar9;
  undefined1 *puVar10;
  uint uVar11;
  int local_20;
  
  uVar7 = g_CommentarySystem._16_4_;
  if (g_CommentarySystem._16_4_ != *(int *)(this + 0x1498)) {
    if (this[0x6c] == (CPointCommentaryNode)0x0) {
      pCVar2 = *(CBaseEdict **)(this + 0x30);
      if (pCVar2 != (CBaseEdict *)0x0) {
        *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
        *(undefined2 *)(iVar3 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CPointCommentaryNode)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x1498) = uVar7;
  }
  if (*(char **)(this + 0x1404) != (char *)0x0) {
    piVar4 = (int *)CGlobalEntityList::FindEntityByName
                              ((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,
                               *(char **)(this + 0x1404),(CBaseEntity *)0x0,(CBaseEntity *)0x0,
                               (CBaseEntity *)0x0,(IEntityFindFilter *)0x0);
    if (piVar4 == (int *)0x0) {
      *(undefined4 *)(this + 0x1408) = 0xffffffff;
    }
    else {
      puVar5 = (uint *)(**(code **)(*piVar4 + 0xc))(piVar4);
      puVar9 = g_pEntityList;
      uVar11 = *puVar5;
      *(uint *)(this + 0x1408) = uVar11;
      if ((((uVar11 != 0xffffffff) &&
           (puVar9 = puVar9 + (uVar11 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
          (*(uint *)(puVar9 + 8) == uVar11 >> 0xc)) && (*(int *)(puVar9 + 4) != 0))
      goto LAB_0064bdb8;
    }
    puVar6 = *(undefined1 **)(this + 0x1404);
    if (puVar6 == (undefined1 *)0x0) {
      puVar6 = &DAT_00d539c2;
    }
    uVar7 = CBaseEntity::GetDebugName((CBaseEntity *)this);
    puVar10 = &DAT_00d539c2;
    if (*(undefined1 **)(this + 0x7c) != (undefined1 *)0x0) {
      puVar10 = *(undefined1 **)(this + 0x7c);
    }
    Warning("%s: %s could not find viewtarget %s.\n",puVar10,uVar7,puVar6);
  }
LAB_0064bdb8:
  if (*(char **)(this + 0x1410) != (char *)0x0) {
    piVar4 = (int *)CGlobalEntityList::FindEntityByName
                              ((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,
                               *(char **)(this + 0x1410),(CBaseEntity *)0x0,(CBaseEntity *)0x0,
                               (CBaseEntity *)0x0,(IEntityFindFilter *)0x0);
    if (piVar4 == (int *)0x0) {
      uVar11 = 0xffffffff;
      local_20 = 0;
    }
    else {
      puVar5 = (uint *)(**(code **)(*piVar4 + 0xc))(piVar4);
      uVar11 = *puVar5;
      if (((uVar11 == 0xffffffff) ||
          (puVar9 = g_pEntityList + (uVar11 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
         (*(uint *)(puVar9 + 8) != uVar11 >> 0xc)) {
        local_20 = 0;
      }
      else {
        local_20 = *(int *)(puVar9 + 4);
      }
    }
    puVar9 = g_pEntityList;
    uVar8 = *(uint *)(this + 0x1414);
    if (((uVar8 == 0xffffffff) ||
        (puVar1 = g_pEntityList + (uVar8 & 0xfff) * 0x10, puVar1 == (undefined *)0xfffffffc)) ||
       (*(uint *)(puVar1 + 8) != uVar8 >> 0xc)) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(puVar1 + 4);
    }
    if (local_20 != iVar3) {
      if (this[0x6c] == (CPointCommentaryNode)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar3 + 2) = 0;
          puVar9 = g_pEntityList;
        }
      }
      else {
        this[0x70] = (CPointCommentaryNode)((byte)this[0x70] | 1);
      }
      *(uint *)(this + 0x1414) = uVar11;
      uVar8 = uVar11;
    }
    if ((((uVar8 != 0xffffffff) &&
         (puVar9 = puVar9 + (uVar8 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
        (*(uint *)(puVar9 + 8) == uVar8 >> 0xc)) && (*(int *)(puVar9 + 4) != 0)) {
      CBaseAnimating::Activate((CBaseAnimating *)this);
      return;
    }
    puVar6 = *(undefined1 **)(this + 0x1410);
    if (puVar6 == (undefined1 *)0x0) {
      puVar6 = &DAT_00d539c2;
    }
    uVar7 = CBaseEntity::GetDebugName((CBaseEntity *)this);
    puVar10 = &DAT_00d539c2;
    if (*(undefined1 **)(this + 0x7c) != (undefined1 *)0x0) {
      puVar10 = *(undefined1 **)(this + 0x7c);
    }
    Warning("%s: %s could not find viewposition %s.\n",puVar10,uVar7,puVar6);
  }
  CBaseAnimating::Activate((CBaseAnimating *)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)