L L4D2node

CCSGameRules::TerminateRound

0x00438910 · 602 bytes · __thiscall

_ZN12CCSGameRules14TerminateRoundEfi

Decompiled

undefined (3 params)

/* CCSGameRules::TerminateRound(float, int) */

void __thiscall CCSGameRules::TerminateRound(CCSGameRules *this,float param_1,int param_2)

{
  int iVar1;
  int *piVar2;
  undefined4 uVar3;
  longdouble lVar4;
  char *local_24;
  
  switch(param_2) {
  default:
    DevMsg("TerminateRound: unknown round end ID %i\n",param_2);
    local_24 = "UNKNOWN";
    uVar3 = 0;
    break;
  case 1:
    local_24 = "#Target_Bombed";
    uVar3 = 2;
    break;
  case 2:
    local_24 = "#VIP_Escaped";
    uVar3 = 3;
    break;
  case 3:
    local_24 = "#VIP_Assassinated";
    uVar3 = 2;
    break;
  case 4:
    local_24 = "#Terrorists_Escaped";
    uVar3 = 2;
    break;
  case 5:
    local_24 = "#CTs_PreventEscape";
    uVar3 = 3;
    break;
  case 6:
    local_24 = "#Escaping_Terrorists_Neutralized";
    uVar3 = 3;
    break;
  case 7:
    local_24 = "#Bomb_Defused";
    uVar3 = 3;
    break;
  case 8:
    local_24 = "#CTs_Win";
    uVar3 = 3;
    break;
  case 9:
    local_24 = "#Terrorists_Win";
    uVar3 = 2;
    break;
  case 10:
    local_24 = "#Round_Draw";
    uVar3 = 1;
    break;
  case 0xb:
    local_24 = "#All_Hostages_Rescued";
    uVar3 = 3;
    break;
  case 0xc:
    local_24 = "#Target_Saved";
    uVar3 = 3;
    break;
  case 0xd:
    local_24 = "#Hostages_Not_Rescued";
    uVar3 = 2;
    break;
  case 0xe:
    local_24 = "#Terrorists_Not_Escaped";
    uVar3 = 3;
    break;
  case 0xf:
    local_24 = "#VIP_Not_Escaped";
    uVar3 = 2;
    break;
  case 0x10:
    local_24 = "#Game_Commencing";
    uVar3 = 1;
  }
  iVar1 = gpGlobals;
  *(undefined4 *)(this + 600) = uVar3;
  piVar2 = gameeventmanager;
  *(float *)(this + 0x268) = param_1 + *(float *)(iVar1 + 0xc);
  piVar2 = (int *)(**(code **)(*piVar2 + 0x1c))(piVar2,"round_end",0,0);
  if (piVar2 != (int *)0x0) {
    (**(code **)(*piVar2 + 0x30))(piVar2,"winner",uVar3);
    (**(code **)(*piVar2 + 0x30))(piVar2,"reason",param_2);
    (**(code **)(*piVar2 + 0x3c))(piVar2,"message",local_24);
    (**(code **)(*piVar2 + 0x30))(piVar2,"priority",6);
    (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar2,0);
  }
  lVar4 = (longdouble)GetMapRemainingTime(this);
  if ((float)lVar4 != 0.0) {
    return;
  }
  UTIL_LogPrintf("World triggered \"Intermission_Time_Limit\"\n");
                    /* WARNING: Could not recover jumptable at 0x00438bde. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  (**(code **)(*(int *)this + 0x248))();
  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)