L L4D2node

Music::OnPlayerRestored

0x008f5230 · 364 bytes · __thiscall

_ZN5Music16OnPlayerRestoredEP13CTerrorPlayer

Decompiled

undefined (2 params)

/* Music::OnPlayerRestored(CTerrorPlayer*) */

void __thiscall Music::OnPlayerRestored(Music *this,CTerrorPlayer *param_1)

{
  char cVar1;
  int iVar2;
  char *pcVar3;
  
  if (param_1 == (CTerrorPlayer *)0x0) {
    Reset(this);
    return;
  }
  Init(this);
  if (*(int *)(param_1 + 0x30) == 0) {
    iVar2 = 0;
  }
  else {
    iVar2 = *(int *)(param_1 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
  }
  pcVar3 = (char *)UTIL_VarArgs("%d",iVar2);
  SendCommand(this,"PlayerRestored",pcVar3,"",-10);
  iVar2 = CBaseEntity::GetTeamNumber(*(CBaseEntity **)(this + 0x378));
  if ((((iVar2 == 2) &&
       (iVar2 = CNavMesh::GetNearestNavArea(TheNavMesh,*(CBaseEntity **)(this + 0x378),5,50.0),
       iVar2 != 0)) && ((*(byte *)(iVar2 + 0x12d) & 8) != 0)) &&
     (cVar1 = CDirector::HasAnySurvivorLeftSafeArea(TheDirector), cVar1 == '\0')) {
    iVar2 = TerrorNavMesh::GetCheckpoint((TerrorNavMesh *)TheNavMesh,(Vector *)(iVar2 + 0x2c));
    if (((iVar2 == 0) || (*(char *)(iVar2 + 0x5f) != '\0')) ||
       (iVar2 = CDirector::GetMapNumber(TheDirector), iVar2 != 0)) {
      iVar2 = TerrorNavMesh::GetLastCheckpoint((TerrorNavMesh *)TheNavMesh);
      if (iVar2 == 0) {
        iVar2 = *(int *)(MusicManagerOn._28_4_ + 0x30);
      }
      else {
        iVar2 = *(int *)(MusicManagerOn._28_4_ + 0x30);
      }
    }
    else {
      iVar2 = *(int *)(MusicManagerOn._28_4_ + 0x30);
    }
    if (iVar2 != 0) {
      SetCheckPoint(this,(int)param_1);
      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)