Host_Map_Helper
0x0017e4e0 · 845 bytes · __cdecl
_Z15Host_Map_HelperRK8CCommand9EMapFlags
Decompiled
undefined (2 params)
/* Host_Map_Helper(CCommand const&, EMapFlags) */
void Host_Map_Helper(CCommand *param_1)
{
char cVar1;
int iVar2;
char *pcVar3;
uint extraout_ECX;
int in_GS_OFFSET;
double dVar4;
float local_f8;
float local_f4;
float local_f0;
float local_ec;
float local_e8;
float local_e4;
char local_e0 [96];
char local_80 [96];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (cmd_source == 1) {
if (*(int *)param_1 < 2) {
Warning("No map specified\n");
}
else {
V_StripExtension(*(char **)(param_1 + 0x40c),local_80,0x60);
cVar1 = (**(code **)(*(int *)modelloader + 0x44))(modelloader,local_80,1);
if (cVar1 == '\0') {
Host_Map_Helper_FuzzyName(param_1,local_80,extraout_ECX);
cVar1 = (**(code **)(*(int *)modelloader + 0x44))(modelloader,local_80,0);
if (cVar1 == '\0') {
Warning("map load failed: %s not found or invalid\n",local_80);
goto LAB_0017e503;
}
}
GetPlatformMapPath(local_80,local_e0,0x60);
COM_TimestampedLog("*** Map Load: %s",local_e0);
SetLaunchOptions(param_1);
cVar1 = CL_HL2Demo_MapCheck(local_e0);
if (cVar1 != '\0') {
cVar1 = CL_PortalDemo_MapCheck(local_e0);
if (cVar1 != '\0') {
Host_Disconnect(false);
HostState_NewGame(local_e0,false,false,false);
if (*(int *)param_1 == 10) {
iVar2 = _V_stricmp(*(char **)(param_1 + 0x410),"setpos");
if (iVar2 == 0) {
pcVar3 = "";
if (6 < *(int *)param_1) {
pcVar3 = *(char **)(param_1 + 0x420);
}
iVar2 = _V_stricmp(pcVar3,"setang");
if (iVar2 == 0) {
pcVar3 = "";
if (3 < *(int *)param_1) {
pcVar3 = *(char **)(param_1 + 0x414);
}
dVar4 = strtod(pcVar3,(char **)0x0);
pcVar3 = "";
local_f8 = (float)dVar4;
if (4 < *(int *)param_1) {
pcVar3 = *(char **)(param_1 + 0x418);
}
dVar4 = strtod(pcVar3,(char **)0x0);
pcVar3 = "";
local_f4 = (float)dVar4;
if (5 < *(int *)param_1) {
pcVar3 = *(char **)(param_1 + 0x41c);
}
dVar4 = strtod(pcVar3,(char **)0x0);
pcVar3 = "";
local_f0 = (float)dVar4;
if (7 < *(int *)param_1) {
pcVar3 = *(char **)(param_1 + 0x424);
}
dVar4 = strtod(pcVar3,(char **)0x0);
pcVar3 = "";
local_ec = (float)dVar4;
if (8 < *(int *)param_1) {
pcVar3 = *(char **)(param_1 + 0x428);
}
dVar4 = strtod(pcVar3,(char **)0x0);
pcVar3 = "";
local_e8 = (float)dVar4;
if (9 < *(int *)param_1) {
pcVar3 = *(char **)(param_1 + 0x42c);
}
dVar4 = strtod(pcVar3,(char **)0x0);
local_e4 = (float)dVar4;
HostState_SetSpawnPoint((Vector *)&local_f8,(QAngle *)&local_ec);
}
}
}
goto LAB_0017e503;
}
}
Warning("map load failed: %s not found or invalid\n",local_e0);
}
}
LAB_0017e503:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.