L L4D2node

CEntityFlame::AttachToEntity

0x0067a470 · 383 bytes · __thiscall

_ZN12CEntityFlame14AttachToEntityEP11CBaseEntity

Decompiled

undefined (2 params)

/* CEntityFlame::AttachToEntity(CBaseEntity*) */

void __thiscall CEntityFlame::AttachToEntity(CEntityFlame *this,CBaseEntity *param_1)

{
  uint uVar1;
  CBaseEdict *this_00;
  char *pcVar2;
  char cVar3;
  int iVar4;
  undefined4 *puVar5;
  char *pcVar6;
  CBaseEntity *pCVar7;
  undefined *puVar8;
  bool bVar9;
  
  pCVar7 = (CBaseEntity *)0x0;
  uVar1 = *(uint *)(this + 0x440);
  if (((uVar1 != 0xffffffff) &&
      (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar8 + 8) == uVar1 >> 0xc)) {
    pCVar7 = *(CBaseEntity **)(puVar8 + 4);
  }
  if (param_1 != pCVar7) {
    if (this[0x6c] == (CEntityFlame)0x0) {
      this_00 = *(CBaseEdict **)(this + 0x30);
      if (this_00 != (CBaseEdict *)0x0) {
        *(uint *)this_00 = *(uint *)this_00 | 0x101;
        iVar4 = CBaseEdict::GetChangeAccessor(this_00);
        *(undefined2 *)(iVar4 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CEntityFlame)((byte)this[0x70] | 1);
    }
    if (param_1 == (CBaseEntity *)0x0) {
      *(undefined4 *)(this + 0x440) = 0xffffffff;
    }
    else {
      puVar5 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
      *(undefined4 *)(this + 0x440) = *puVar5;
    }
  }
  iVar4 = CBaseEntity::GetTeamNumber(param_1);
  cVar3 = IsASurvivorTeam(iVar4);
  if (cVar3 == '\0') {
    cVar3 = (**(code **)(*(int *)param_1 + 0x140))(param_1);
    if (((cVar3 == '\0') && (cVar3 = (**(code **)(*(int *)param_1 + 0x16c))(param_1), cVar3 == '\0')
        ) && (iVar4 = (**(code **)(*(int *)param_1 + 0x144))(param_1),
             pcVar2 = g_BurningObjectString, iVar4 == 0)) {
      bVar9 = g_BurningObjectString != (char *)0x0;
      *(char **)(this + 0x45c) = g_BurningObjectString;
      pcVar6 = "";
      if (bVar9) {
        pcVar6 = pcVar2;
      }
      CBaseEntity::EmitSound((CBaseEntity *)this,pcVar6,&g_BurningObjectHandle,0.0,(float *)0x0);
    }
    else {
      pcVar2 = g_BurningFleshString;
      bVar9 = g_BurningFleshString != (char *)0x0;
      *(char **)(this + 0x45c) = g_BurningFleshString;
      pcVar6 = "";
      if (bVar9) {
        pcVar6 = pcVar2;
      }
      CBaseEntity::EmitSound((CBaseEntity *)this,pcVar6,&g_BurningFleshHandle,0.0,(float *)0x0);
    }
  }
  else {
    *(undefined4 *)(this + 0x45c) = 0;
  }
  (**(code **)(*(int *)this + 0x98))(this,param_1,0xffffffff);
  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)