CChangeDifficultyIssue::CanCallVote
0x00a05550 · 337 bytes · __thiscall
_ZN22CChangeDifficultyIssue11CanCallVoteEiPKcPc
Decompiled
undefined (4 params)
/* CChangeDifficultyIssue::CanCallVote(int, char const*, char*) */
undefined4 __thiscall
CChangeDifficultyIssue::CanCallVote
(CChangeDifficultyIssue *this,int param_1,char *param_2,char *param_3)
{
char cVar1;
undefined4 uVar2;
int iVar3;
undefined4 uVar4;
char *pcVar5;
cVar1 = CBaseTerrorIssue::CanCallVote((CBaseTerrorIssue *)this,param_1,param_2,param_3);
if ((cVar1 != '\0') &&
(uVar2 = CTerrorGameRules::HasConfigurableDifficultySetting(), (char)uVar2 != '\0')) {
if (*(int *)(sv_vote_issue_change_difficulty_allowed._28_4_ + 0x30) == 0) {
V_strncpy(param_3,"Server has disabled that Issue.",0x60);
return 0;
}
if (((((param_2 == "Impossible") || (iVar3 = _V_stricmp("Impossible",param_2), iVar3 == 0)) ||
(param_2 == "Normal")) ||
((iVar3 = _V_stricmp("Normal",param_2), iVar3 == 0 || (param_2 == "Hard")))) ||
((iVar3 = _V_stricmp("Hard",param_2), iVar3 == 0 ||
((param_2 == "Easy" || (iVar3 = _V_stricmp("Easy",param_2), iVar3 == 0)))))) {
uVar4 = GetDifficulty();
pcVar5 = (char *)GetDifficultyString(uVar4);
if ((param_2 != pcVar5) && (iVar3 = _V_stricmp(param_2,pcVar5), iVar3 != 0)) {
return uVar2;
}
V_snprintf(param_3,0x60,"Difficulty is already %s.",param_2);
return 0;
}
V_strncpy(param_3,"Needs arg of Easy, Normal, Hard, or Impossible.",0x60);
}
return 0;
}
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.