L L4D2node

CDirectorScavengeMode::IncrementScavengeTeamScoreNonVirtual

0x008b2dc0 · 413 bytes · __cdecl

_ZN21CDirectorScavengeMode36IncrementScavengeTeamScoreNonVirtualEi

Decompiled

undefined (1 param)

/* CDirectorScavengeMode::IncrementScavengeTeamScoreNonVirtual(int) */

void CDirectorScavengeMode::IncrementScavengeTeamScoreNonVirtual(int param_1)

{
  CTerrorGameRules *pCVar1;
  char cVar2;
  CTerrorGameRules *this;
  int iVar3;
  int iVar4;
  longdouble lVar5;
  longdouble lVar6;
  
  cVar2 = CTerrorGameRules::IsScavengeMode();
  if (cVar2 != '\0') {
    iVar3 = *(int *)(TheDirector + 0x3a0);
    *(int *)(TheDirector + 0x3a0) = iVar3 + -1;
    CTerrorGameRules::SetScavengeItemsRemaining(g_pGameRules,iVar3 + -1);
    pCVar1 = g_pGameRules;
    *(undefined4 *)(param_1 + 4) = *(undefined4 *)(gpGlobals + 0xc);
    this = (CTerrorGameRules *)0x0;
    if (pCVar1 != (CTerrorGameRules *)0x0) {
      lVar5 = (longdouble)
              CDirector::GetScriptValue
                        (TheDirector,"ScavengeScoreBonusTime",
                         *(float *)(scavenge_score_bonus_time._28_4_ + 0x2c));
      lVar6 = (longdouble)CTerrorGameRules::GetRemainingAccumulatedTime(g_pGameRules);
      if ((float)lVar6 <= 0.0) {
        CTerrorGameRules::ClearAccumulatedTime(g_pGameRules);
        lVar6 = (longdouble)CTerrorGameRules::GetRoundDuration(g_pGameRules,2);
        CTerrorGameRules::AccumulateTime(g_pGameRules,(float)lVar6 + (float)lVar5);
      }
      else {
        CTerrorGameRules::AccumulateTime(g_pGameRules,(float)lVar5);
      }
      *(undefined4 *)(param_1 + 0x28) = 0;
      this = g_pGameRules;
    }
    iVar3 = CTerrorGameRules::GetScavengeTeamScore(this,2,-1);
    iVar4 = CTerrorGameRules::GetScavengeTeamScore(g_pGameRules,3,-1);
    if (iVar3 == iVar4) {
      iVar3 = (**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"scavenge_score_tied",0,0);
      if (iVar3 != 0) {
        (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,iVar3,0);
      }
    }
  }
  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)