L L4D2node

GetNumCansToWin

0x00537a10 · 117 bytes · unknown

_ZL15GetNumCansToWinv

Decompiled

undefined (0 params)

/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* GetNumCansToWin() */

int GetNumCansToWin(void)

{
  char cVar1;
  int iVar2;
  int iVar3;
  
  iVar2 = CTerrorGameRules::GetScavengeTeamScore(g_pGameRules,2,-1);
  iVar3 = CTerrorGameRules::GetScavengeItemsGoal(g_pGameRules);
  cVar1 = CTerrorGameRules::IsScavengeMode();
  iVar3 = iVar3 - iVar2;
  if ((cVar1 != '\0') && (g_pGameRules[0x491] != (CTerrorGameRules)0x0)) {
    iVar3 = CTerrorGameRules::GetScavengeTeamScore(g_pGameRules,3,-1);
    iVar3 = (iVar3 - iVar2) + 1;
  }
  return iVar3;
}

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)