L L4D2node

Music::OnChargerSpawn

0x008eaa20 · 1266 bytes · __thiscall

_ZN5Music14OnChargerSpawnEv

Decompiled

undefined (1 param)

/* Music::OnChargerSpawn() */

void __thiscall Music::OnChargerSpawn(Music *this)

{
  float fVar1;
  longdouble lVar2;
  
  fVar1 = *(float *)(this + 0x144);
  lVar2 = (longdouble)CountdownTimer::Now();
  if (fVar1 - (float)lVar2 < 0.5) {
    lVar2 = (longdouble)RandomFloat(0x3f000000,0x3f800000);
    fVar1 = (float)lVar2;
    lVar2 = (longdouble)CountdownTimer::Now();
    if ((float)lVar2 + fVar1 != *(float *)(this + 0x144)) {
      (**(code **)(*(int *)(this + 0x13c) + 4))(this + 0x13c,this + 0x144);
      *(float *)(this + 0x144) = (float)lVar2 + fVar1;
    }
    if (fVar1 != *(float *)(this + 0x140)) {
      (**(code **)(*(int *)(this + 0x13c) + 4))(this + 0x13c,this + 0x140);
      *(float *)(this + 0x140) = fVar1;
    }
  }
  fVar1 = *(float *)(this + 0x120);
  lVar2 = (longdouble)CountdownTimer::Now();
  if (fVar1 - (float)lVar2 < 1.5) {
    lVar2 = (longdouble)CountdownTimer::Now();
    if ((float)lVar2 + 1.5 != *(float *)(this + 0x120)) {
      (**(code **)(*(int *)(this + 0x118) + 4))(this + 0x118,this + 0x120);
      *(float *)(this + 0x120) = (float)lVar2 + 1.5;
    }
    if (*(float *)(this + 0x11c) != 1.5) {
      (**(code **)(*(int *)(this + 0x118) + 4))(this + 0x118,this + 0x11c);
      *(undefined4 *)(this + 0x11c) = 0x3fc00000;
    }
  }
  fVar1 = *(float *)(this + 0x114);
  lVar2 = (longdouble)CountdownTimer::Now();
  if (fVar1 - (float)lVar2 < 1.6) {
    lVar2 = (longdouble)CountdownTimer::Now();
    if ((float)lVar2 + 1.6 != *(float *)(this + 0x114)) {
      (**(code **)(*(int *)(this + 0x10c) + 4))(this + 0x10c,this + 0x114);
      *(float *)(this + 0x114) = (float)lVar2 + 1.6;
    }
    if (*(float *)(this + 0x110) != 1.6) {
      (**(code **)(*(int *)(this + 0x10c) + 4))(this + 0x10c,this + 0x110);
      *(undefined4 *)(this + 0x110) = 0x3fcccccd;
    }
  }
  fVar1 = *(float *)(this + 300);
  lVar2 = (longdouble)CountdownTimer::Now();
  if (fVar1 - (float)lVar2 < 1.7) {
    lVar2 = (longdouble)CountdownTimer::Now();
    if ((float)lVar2 + 1.7 != *(float *)(this + 300)) {
      (**(code **)(*(int *)(this + 0x124) + 4))(this + 0x124,this + 300);
      *(float *)(this + 300) = (float)lVar2 + 1.7;
    }
    if (*(float *)(this + 0x128) != 1.7) {
      (**(code **)(*(int *)(this + 0x124) + 4))(this + 0x124,this + 0x128);
      *(undefined4 *)(this + 0x128) = 0x3fd9999a;
    }
  }
  fVar1 = *(float *)(this + 0x138);
  lVar2 = (longdouble)CountdownTimer::Now();
  if (fVar1 - (float)lVar2 < 1.8) {
    lVar2 = (longdouble)CountdownTimer::Now();
    if ((float)lVar2 + 1.8 != *(float *)(this + 0x138)) {
      (**(code **)(*(int *)(this + 0x130) + 4))(this + 0x130,this + 0x138);
      *(float *)(this + 0x138) = (float)lVar2 + 1.8;
    }
    if (*(float *)(this + 0x134) != 1.8) {
      (**(code **)(*(int *)(this + 0x130) + 4))(this + 0x130,this + 0x134);
      *(undefined4 *)(this + 0x134) = 0x3fe66666;
    }
  }
  fVar1 = *(float *)(this + 0x150);
  lVar2 = (longdouble)CountdownTimer::Now();
  if (fVar1 - (float)lVar2 < 1.9) {
    lVar2 = (longdouble)CountdownTimer::Now();
    if ((float)lVar2 + 1.9 != *(float *)(this + 0x150)) {
      (**(code **)(*(int *)(this + 0x148) + 4))(this + 0x148,this + 0x150);
      *(float *)(this + 0x150) = (float)lVar2 + 1.9;
    }
    if (*(float *)(this + 0x14c) != 1.9) {
      (**(code **)(*(int *)(this + 0x148) + 4))(this + 0x148,this + 0x14c);
      *(undefined4 *)(this + 0x14c) = 0x3ff33333;
      return;
    }
  }
  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)