L L4D2node

CDirectorVersusMode::UpdateMarkersReached

0x008c3d30 · 451 bytes · __thiscall

_ZN19CDirectorVersusMode20UpdateMarkersReachedEv

Decompiled

undefined (1 param)

/* CDirectorVersusMode::UpdateMarkersReached() */

void __thiscall CDirectorVersusMode::UpdateMarkersReached(CDirectorVersusMode *this)

{
  int iVar1;
  int iVar2;
  int *piVar3;
  int iVar4;
  int iVar5;
  longdouble lVar6;
  float fVar7;
  float fVar8;
  int local_24;
  
  if ((*(int *)(this + 0x48) < *(int *)(this + 0x4c)) && (0 < *(int *)(this + 0x4c))) {
    iVar5 = 0;
    local_24 = -1;
    iVar4 = -1;
    do {
      iVar1 = CTerrorGameRules::GetVersusCompletionPerCharacter(g_pGameRules,iVar5,2);
      if (iVar4 < iVar1) {
        iVar2 = CTerrorPlayer::GetPlayerByCharacter(iVar5);
        iVar4 = iVar1;
        if (iVar2 != 0) {
          local_24 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(iVar2 + 0x30));
        }
      }
      iVar5 = iVar5 + 1;
    } while (iVar5 != 4);
    iVar5 = CTerrorGameRules::GetVersusMaxCompletionScore(g_pGameRules);
    fVar7 = ((float)iVar4 / (float)(iVar5 >> 2)) * 100.0;
    fVar8 = (100.0 / (float)(*(int *)(this + 0x4c) + 1)) * (float)(*(int *)(this + 0x48) + 1);
    if (((fVar8 <= fVar7) && (*(int *)(this + 0x48) = *(int *)(this + 0x48) + 1, fVar7 < 80.0)) &&
       (0 < local_24)) {
      piVar3 = (int *)(**(code **)(*gameeventmanager + 0x1c))
                                (gameeventmanager,"versus_marker_reached",0,0);
      if (piVar3 != (int *)0x0) {
        (**(code **)(*piVar3 + 0x30))(piVar3,"userid",local_24);
        (**(code **)(*piVar3 + 0x30))(piVar3,"marker",(int)fVar8);
        (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar3,0);
      }
    }
    lVar6 = (longdouble)CountdownTimer::Now();
    fVar7 = *(float *)(this + 0x54);
    if ((float)lVar6 + fVar7 != *(float *)(this + 0x58)) {
      (**(code **)(*(int *)(this + 0x50) + 4))(this + 0x50,this + 0x58);
      *(float *)(this + 0x58) = (float)lVar6 + fVar7;
      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)