L L4D2node

CFish::Initialize

0x006a41b0 · 730 bytes · __thiscall

_ZN5CFish10InitializeEP9CFishPoolj

Decompiled

undefined (3 params)

/* CFish::Initialize(CFishPool*, unsigned int) */

void __thiscall CFish::Initialize(CFish *this,CFishPool *param_1,uint param_2)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  CFishPool CVar5;
  undefined4 uVar6;
  code *UNRECOVERED_JUMPTABLE;
  CBaseEdict *pCVar7;
  undefined4 *puVar8;
  int iVar9;
  undefined4 local_20 [4];
  
  if (param_1 == (CFishPool *)0x0) {
    *(undefined4 *)(this + 0x13f4) = 0xffffffff;
    *(uint *)(this + 0x13f8) = param_2;
    CVar5 = CRam0000014d;
  }
  else {
    puVar8 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
    uVar6 = *puVar8;
    *(uint *)(this + 0x13f8) = param_2;
    *(undefined4 *)(this + 0x13f4) = uVar6;
    CVar5 = param_1[0x14d];
  }
  if (((byte)CVar5 & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
  }
  fVar1 = *(float *)(param_1 + 0x2e0);
  fVar2 = *(float *)(param_1 + 0x2e4);
  fVar3 = *(float *)(param_1 + 0x2e8);
  if (((fVar1 != *(float *)(this + 0x1428)) || (fVar2 != *(float *)(this + 0x142c))) ||
     (fVar3 != *(float *)(this + 0x1430))) {
    if (this[0x6c] == (CFish)0x0) {
      pCVar7 = *(CBaseEdict **)(this + 0x30);
      if (pCVar7 != (CBaseEdict *)0x0) {
        *(uint *)pCVar7 = *(uint *)pCVar7 | 0x101;
        iVar9 = CBaseEdict::GetChangeAccessor(pCVar7);
        *(undefined2 *)(iVar9 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CFish)((byte)this[0x70] | 1);
    }
    *(float *)(this + 0x1428) = fVar1;
    *(float *)(this + 0x142c) = fVar2;
    *(float *)(this + 0x1430) = fVar3;
  }
  fVar1 = *(float *)(param_1 + 0x458);
  if (fVar1 != *(float *)(this + 0x1434)) {
    if (this[0x6c] == (CFish)0x0) {
      pCVar7 = *(CBaseEdict **)(this + 0x30);
      if (pCVar7 != (CBaseEdict *)0x0) {
        *(uint *)pCVar7 = *(uint *)pCVar7 | 0x101;
        iVar9 = CBaseEdict::GetChangeAccessor(pCVar7);
        *(undefined2 *)(iVar9 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CFish)((byte)this[0x70] | 1);
    }
    *(float *)(this + 0x1434) = fVar1;
  }
  if (((byte)this[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
  }
  fVar1 = *(float *)(this + 0x2e0);
  fVar2 = *(float *)(this + 0x2e4);
  fVar3 = *(float *)(this + 0x1428);
  fVar4 = *(float *)(this + 0x142c);
  if (fVar1 - fVar3 != *(float *)(this + 0x13fc)) {
    if (this[0x6c] == (CFish)0x0) {
      pCVar7 = *(CBaseEdict **)(this + 0x30);
      if (pCVar7 != (CBaseEdict *)0x0) {
        *(uint *)pCVar7 = *(uint *)pCVar7 | 0x101;
        iVar9 = CBaseEdict::GetChangeAccessor(pCVar7);
        *(undefined2 *)(iVar9 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CFish)((byte)this[0x70] | 1);
    }
    *(float *)(this + 0x13fc) = fVar1 - fVar3;
  }
  if (fVar2 - fVar4 != *(float *)(this + 0x1400)) {
    if (this[0x6c] == (CFish)0x0) {
      pCVar7 = *(CBaseEdict **)(this + 0x30);
      if (pCVar7 != (CBaseEdict *)0x0) {
        *(uint *)pCVar7 = *(uint *)pCVar7 | 0x101;
        iVar9 = CBaseEdict::GetChangeAccessor(pCVar7);
        *(undefined2 *)(iVar9 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CFish)((byte)this[0x70] | 1);
    }
    *(float *)(this + 0x1400) = fVar2 - fVar4;
  }
  fVar1 = *(float *)(this + 0x1430);
  if (fVar1 != *(float *)(this + 0x1404)) {
    if (this[0x6c] == (CFish)0x0) {
      pCVar7 = *(CBaseEdict **)(this + 0x30);
      if (pCVar7 != (CBaseEdict *)0x0) {
        *(uint *)pCVar7 = *(uint *)pCVar7 | 0x101;
        iVar9 = CBaseEdict::GetChangeAccessor(pCVar7);
        *(undefined2 *)(iVar9 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CFish)((byte)this[0x70] | 1);
    }
    *(float *)(this + 0x1404) = fVar1;
  }
  UNRECOVERED_JUMPTABLE = *(code **)(*(int *)this + 0x70);
  (**(code **)(*(int *)param_1 + 0x20))(local_20,param_1);
                    /* WARNING: Could not recover jumptable at 0x006a42d0. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  (*UNRECOVERED_JUMPTABLE)();
  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)