CVersusRandom::PickStoredRandom
0x006ebe70 · 183 bytes · __thiscall
_ZN13CVersusRandom16PickStoredRandomER11inputdata_t
Decompiled
undefined (2 params)
/* CVersusRandom::PickStoredRandom(inputdata_t&) */
void __thiscall CVersusRandom::PickStoredRandom(CVersusRandom *this,inputdata_t *param_1)
{
int iVar1;
int iVar2;
char *pcVar3;
undefined1 *puVar4;
if (*(int *)(this + 0x610) == 0) {
pcVar3 =
"logic_versus_random entity %s being asked to pick random numbers in second round when none were picked first round!\n"
;
puVar4 = &DAT_00d539c2;
if (*(undefined1 **)(this + 0x154) != (undefined1 *)0x0) {
puVar4 = *(undefined1 **)(this + 0x154);
}
}
else {
iVar1 = *(int *)(this + 0x618);
if (iVar1 < *(int *)(this + 0x610)) {
iVar2 = *(int *)(*(int *)(this + 0x604) + iVar1 * 4);
*(int *)(this + 0x618) = iVar1 + 1;
COutputEvent::FireOutput
((COutputEvent *)(this + iVar2 * 0x18 + 0x440),*(CBaseEntity **)param_1,
(CBaseEntity *)this,0.0);
return;
}
pcVar3 =
"logic_versus_random entity %s being asked to pick more random numbers in second round than in the first round!\n"
;
puVar4 = &DAT_00d539c2;
if (*(undefined1 **)(this + 0x154) != (undefined1 *)0x0) {
puVar4 = *(undefined1 **)(this + 0x154);
}
}
DevWarning(pcVar3,puVar4);
PickNewRandom(this,false,param_1);
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.