L L4D2node

CEntityFlame::Create

0x0067a610 · 707 bytes · __cdecl

_ZN12CEntityFlame6CreateEP11CBaseEntityffb

Decompiled

undefined (4 params)

/* CEntityFlame::Create(CBaseEntity*, float, float, bool) */

CBaseEntity * CEntityFlame::Create(CBaseEntity *param_1,float param_2,float param_3,bool param_4)

{
  CBaseEntity *pCVar1;
  float fVar2;
  float fVar3;
  CBaseEdict *pCVar4;
  CBaseEntity *this;
  int iVar5;
  float *pfVar6;
  float fVar7;
  undefined1 local_24 [20];
  
  this = (CBaseEntity *)CreateEntityByName("entityflame",-1,true);
  if (this == (CBaseEntity *)0x0) {
    this = (CBaseEntity *)0x0;
  }
  else {
    if (param_3 <= 0.0) {
      pCVar1 = param_1 + 0x194;
      pfVar6 = (float *)(**(code **)(*(int *)(param_1 + 0x194) + 8))(pCVar1);
      fVar7 = *pfVar6;
      pfVar6 = (float *)(**(code **)(*(int *)(param_1 + 0x194) + 4))(pCVar1);
      fVar2 = *pfVar6;
      iVar5 = (**(code **)(*(int *)(param_1 + 0x194) + 8))(pCVar1);
      fVar3 = *(float *)(iVar5 + 4);
      iVar5 = (**(code **)(*(int *)(param_1 + 0x194) + 4))(pCVar1);
      param_3 = (((fVar3 + fVar7) - *(float *)(iVar5 + 4)) - fVar2) * 0.5;
      if (param_3 <= 16.0) {
        param_3 = 16.0;
      }
    }
    if (param_3 != *(float *)(this + 0x448)) {
      if (this[0x6c] == (CBaseEntity)0x0) {
        pCVar4 = *(CBaseEdict **)(this + 0x30);
        if (pCVar4 != (CBaseEdict *)0x0) {
          *(uint *)pCVar4 = *(uint *)pCVar4 | 0x101;
          iVar5 = CBaseEdict::GetChangeAccessor(pCVar4);
          *(undefined2 *)(iVar5 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CBaseEntity)((byte)this[0x70] | 1);
      }
      *(float *)(this + 0x448) = param_3;
    }
    (**(code **)(*(int *)this + 100))(this);
    if (((byte)param_1[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(param_1);
    }
    UTIL_SetOrigin(this,(Vector *)(param_1 + 0x2e0),false);
    CBaseEntity::ThinkSet((_func_void *)local_24,(float)this,(char *)FlameThink);
    CBaseEntity::SetNextThink(this,*(float *)(gpGlobals + 0xc) + 0.1,(char *)0x0);
    AttachToEntity((CEntityFlame *)this,param_1);
    *(uint *)(this + 0x14c) = *(uint *)(this + 0x14c) | 0x80;
    CBaseEntity::DispatchUpdateTransmitState(this);
    if ((CBaseEntity)param_4 != this[0x44c]) {
      if (this[0x6c] == (CBaseEntity)0x0) {
        pCVar4 = *(CBaseEdict **)(this + 0x30);
        if (pCVar4 != (CBaseEdict *)0x0) {
          *(uint *)pCVar4 = *(uint *)pCVar4 | 0x101;
          iVar5 = CBaseEdict::GetChangeAccessor(pCVar4);
          *(undefined2 *)(iVar5 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CBaseEntity)((byte)this[0x70] | 1);
      }
      this[0x44c] = (CBaseEntity)param_4;
    }
    fVar7 = (float)(~-(uint)(0.0 < param_2) & 0x40000000 | (uint)param_2 & -(uint)(0.0 < param_2)) +
            *(float *)(gpGlobals + 0xc);
    if (fVar7 != *(float *)(this + 0x458)) {
      if (this[0x6c] == (CBaseEntity)0x0) {
        pCVar4 = *(CBaseEdict **)(this + 0x30);
        if (pCVar4 != (CBaseEdict *)0x0) {
          *(uint *)pCVar4 = *(uint *)pCVar4 | 0x101;
          iVar5 = CBaseEdict::GetChangeAccessor(pCVar4);
          *(undefined2 *)(iVar5 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CBaseEntity)((byte)this[0x70] | 1);
      }
      *(float *)(this + 0x458) = fVar7;
    }
    (**(code **)(*(int *)this + 0x94))(this);
  }
  return this;
}

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)