L L4D2node

CBasePlayer::UpdateBattery

0x007a9b80 · 152 bytes · __thiscall

_ZN11CBasePlayer13UpdateBatteryEv

Decompiled

undefined (1 param)

/* CBasePlayer::UpdateBattery() */

void __thiscall CBasePlayer::UpdateBattery(CBasePlayer *this)

{
  int iVar1;
  undefined **local_2c [8];
  
  if (*(int *)(this + 0x1f70) != *(int *)(this + 0x1f4c)) {
    *(int *)(this + 0x1f4c) = *(int *)(this + 0x1f70);
    iVar1 = CUserMessages::LookupUserMessage((CUserMessages *)usermessages,"Battery");
    if (iVar1 != -1) {
      CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_2c);
      local_2c[0] = &PTR__CSingleUserRecipientFilter_00c08ea8;
                    /* try { // try from 007a9bd2 to 007a9bd6 has its CatchHandler @ 007a9c18 */
      CRecipientFilter::AddRecipient((CRecipientFilter *)local_2c,this);
                    /* try { // try from 007a9bda to 007a9c01 has its CatchHandler @ 007a9c2a */
      CRecipientFilter::MakeReliable((CRecipientFilter *)local_2c);
      UserMessageBegin((IRecipientFilter *)local_2c,"Battery");
      MessageWriteShort(*(int *)(this + 0x1f70));
      MessageEnd();
      local_2c[0] = &PTR__CSingleUserRecipientFilter_00c08ea8;
      CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_2c);
    }
  }
  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)