CChangeLevel::ChangeLevelNow
0x00b220e0 · 425 bytes · __thiscall
_ZN12CChangeLevel14ChangeLevelNowEP11CBaseEntity
Decompiled
undefined (2 params)
/* CChangeLevel::ChangeLevelNow(CBaseEntity*) */
void __thiscall CChangeLevel::ChangeLevelNow(CChangeLevel *this,CBaseEntity *param_1)
{
int iVar1;
undefined4 *puVar2;
undefined4 uVar3;
if (this[0x5a9] == (CChangeLevel)0x0) {
this[0x5a9] = (CChangeLevel)0x1;
iVar1 = FindLandmark((char *)(this + 0x589));
if (iVar1 != 0) {
g_iDebuggingTransition = 0;
st_szNextSpot[0] = 0;
V_strncpy(st_szNextSpot,(char *)(this + 0x589),0x20);
V_strncpy(st_szNextMap,(char *)(this + 0x569),0x20);
if (param_1 == (CBaseEntity *)0x0) {
*(undefined4 *)(this + 0x494) = 0xffffffff;
}
else {
puVar2 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
*(undefined4 *)(this + 0x494) = *puVar2;
}
COutputEvent::FireOutput((COutputEvent *)(this + 0x5ac),param_1,(CBaseEntity *)this,0.0);
NotifyEntitiesOutOfTransition(this);
if (*(int *)(g_debug_transitions._28_4_ + 0x30) != 0) {
Msg("CHANGE LEVEL: %s %s\n",st_szNextMap,st_szNextSpot);
if (*(int *)(g_debug_transitions._28_4_ + 0x30) != 0) {
iVar1 = SaveInit(0);
if (iVar1 != 0) {
(**(code **)(*(int *)g_pGameSaveRestoreBlockSet + 4))(g_pGameSaveRestoreBlockSet,iVar1);
uVar3 = ChangeList((levellist_t *)(iVar1 + 0x1c),0x10);
*(undefined4 *)(iVar1 + 0x18) = uVar3;
(**(code **)(*(int *)g_pGameSaveRestoreBlockSet + 0x10))(g_pGameSaveRestoreBlockSet);
}
*(undefined4 *)(this + 0xd8) = 0;
*(undefined4 *)(this + 0xdc) = 0;
return;
}
}
(**(code **)(*g_pGameRules + 0x9c))(g_pGameRules,st_szNextMap);
CDirector::DirectorChangelevel(TheDirector,st_szNextMap);
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.