CTerrorGameRules::TerminateRound
0x00502590 · 369 bytes · __thiscall
_ZN16CTerrorGameRules14TerminateRoundEfi
Decompiled
undefined (3 params)
/* CTerrorGameRules::TerminateRound(float, int) */
void __thiscall CTerrorGameRules::TerminateRound(CTerrorGameRules *this,float param_1,int param_2)
{
CDirector *this_00;
char cVar1;
int *piVar2;
undefined4 uVar3;
char *local_20;
switch(param_2) {
default:
uVar3 = 0;
DevMsg("TerminateRound: unknown round end ID %i\n",param_2);
local_20 = "#Game_Commencing";
break;
case 1:
local_20 = "The helicopter has arrived!";
uVar3 = 2;
break;
case 7:
local_20 = "The radio has been destroyed!";
uVar3 = 3;
break;
case 8:
local_20 = "#CTs_Win";
uVar3 = 3;
break;
case 9:
local_20 = "#Terrorists_Win";
uVar3 = 2;
break;
case 10:
local_20 = "#Round_Draw";
uVar3 = 1;
break;
case 0x10:
local_20 = "#Game_Commencing";
uVar3 = 1;
}
this_00 = TheDirector;
*(undefined4 *)(this + 600) = uVar3;
cVar1 = CDirector::IsTransitioned(this_00);
if (cVar1 == '\0') {
*(float *)(this + 0x268) = param_1 + *(float *)(gpGlobals + 0xc);
}
piVar2 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"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_20);
/* WARNING: Could not recover jumptable at 0x0050268b. Too many branches */
/* WARNING: Treating indirect jump as call */
(**(code **)(*gameeventmanager + 0x20))();
return;
}
return;
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.