L L4D2node

CFish::Spawn

0x006a3680 · 1045 bytes · __thiscall

_ZN5CFish5SpawnEv

Decompiled

undefined (1 param)

/* CFish::Spawn() */

void __thiscall CFish::Spawn(CFish *this)

{
  float fVar1;
  CBaseEdict *this_00;
  int iVar2;
  longdouble lVar3;
  longdouble lVar4;
  
  (**(code **)(*(int *)this + 0x6c))(this);
  CCollisionProperty::SetSolid((CCollisionProperty *)(this + 0x194),2);
  CCollisionProperty::SetSolidFlags
            ((CCollisionProperty *)(this + 0x194),(uint)(*(ushort *)(this + 0x1b4) | 0x1c));
  CBaseEntity::SetMoveType((CBaseEntity *)this,4,0);
  lVar3 = (longdouble)RandomFloat(0,0x43b40000);
  if ((float)lVar3 != *(float *)(this + 0x1408)) {
    if (this[0x6c] == (CFish)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;
      }
    }
    else {
      this[0x70] = (CFish)((byte)this[0x70] | 1);
    }
    *(float *)(this + 0x1408) = (float)lVar3;
  }
  *(undefined4 *)(this + 0x140c) = 0;
  *(undefined4 *)(this + 0x1410) = 0x3f800000;
  *(undefined4 *)(this + 0x1414) = 0;
  *(undefined4 *)(this + 0x1418) = 0;
  *(undefined4 *)(this + 0x141c) = 0x80000000;
  *(undefined4 *)(this + 0x1420) = 0x3f800000;
  *(undefined4 *)(this + 0x1424) = 0;
  *(undefined4 *)(this + 0x1438) = 0;
  lVar3 = (longdouble)RandomFloat(0x41200000,0x41a00000);
  *(float *)(this + 0x1440) = (float)lVar3;
  lVar4 = (longdouble)RandomFloat(0x40800000,0x40a00000);
  *(float *)(this + 0x1444) = (float)lVar4 * (float)lVar3;
  *(undefined4 *)(this + 0x143c) = *(undefined4 *)(this + 0x1440);
  iVar2 = RandomInt(0,100);
  this[0x1458] = (CFish)(iVar2 < 0x32);
  lVar3 = (longdouble)RandomFloat(0x42200000,0x42960000);
  *(float *)(this + 0x1448) = (float)lVar3;
  if (*(int *)(this + 0x100) != 1) {
    (**(code **)(*(int *)this + 0x214))(this,this + 0x100);
    *(undefined4 *)(this + 0x100) = 1;
  }
  if (*(int *)(this + 0xfc) != 1) {
    (**(code **)(*(int *)this + 0x20c))(this,this + 0xfc);
    *(undefined4 *)(this + 0xfc) = 1;
  }
  if (this[0x105] != (CFish)0x2) {
    (**(code **)(*(int *)this + 0x224))(this,this + 0x105);
    this[0x105] = (CFish)0x2;
  }
  lVar3 = (longdouble)RandomFloat(0,0x41200000);
  fVar1 = (float)lVar3;
  lVar3 = (longdouble)CountdownTimer::Now();
  if ((float)lVar3 + fVar1 != *(float *)(this + 0x1488)) {
    (**(code **)(*(int *)(this + 0x1480) + 4))(this + 0x1480,this + 0x1488);
    *(float *)(this + 0x1488) = (float)lVar3 + fVar1;
  }
  if (fVar1 != *(float *)(this + 0x1484)) {
    (**(code **)(*(int *)(this + 0x1480) + 4))(this + 0x1480,this + 0x1484);
    *(float *)(this + 0x1484) = fVar1;
  }
  lVar3 = (longdouble)RandomFloat(0x41200000,0x42700000);
  fVar1 = (float)lVar3;
  lVar3 = (longdouble)CountdownTimer::Now();
  if ((float)lVar3 + fVar1 != *(float *)(this + 0x1464)) {
    (**(code **)(*(int *)(this + 0x145c) + 4))(this + 0x145c,this + 0x1464);
    *(float *)(this + 0x1464) = (float)lVar3 + fVar1;
  }
  if (fVar1 != *(float *)(this + 0x1460)) {
    (**(code **)(*(int *)(this + 0x145c) + 4))(this + 0x145c,this + 0x1460);
    *(float *)(this + 0x1460) = fVar1;
  }
  lVar3 = (longdouble)RandomFloat(0x40000000,0x41200000);
  fVar1 = (float)lVar3;
  lVar3 = (longdouble)CountdownTimer::Now();
  if ((float)lVar3 + fVar1 != *(float *)(this + 0x1470)) {
    (**(code **)(*(int *)(this + 0x1468) + 4))(this + 0x1468,this + 0x1470);
    *(float *)(this + 0x1470) = (float)lVar3 + fVar1;
  }
  if (fVar1 != *(float *)(this + 0x146c)) {
    (**(code **)(*(int *)(this + 0x1468) + 4))(this + 0x1468,this + 0x146c);
    *(float *)(this + 0x146c) = fVar1;
  }
  *(undefined4 *)(this + 0x143c) = *(undefined4 *)(this + 0x1440);
  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)