L L4D2node

Host_Changelevel2_f

0x0017dda0 · 376 bytes · __cdecl

_Z19Host_Changelevel2_fRK8CCommand

Decompiled

undefined (1 param)

/* Host_Changelevel2_f(CCommand const&) */

void Host_Changelevel2_f(CCommand *param_1)

{
  char cVar1;
  int iVar2;
  char *pcVar3;
  char *pcVar4;
  undefined1 *puVar5;
  
  if (*(int *)param_1 < 2) {
    ConMsg("changelevel2 <levelname> : continue game on a new level in the unit\n");
    return;
  }
  if (DAT_003b7f64 < 2) {
    ConMsg("Can\'t changelevel2, not in a map\n");
    return;
  }
  iVar2 = (**(code **)(*(int *)g_pVEngineServer + 4))
                    (g_pVEngineServer,*(undefined4 *)(param_1 + 0x40c));
  if (iVar2 == 0) {
    cVar1 = CL_IsHL2Demo();
    if (cVar1 == '\0') {
LAB_0017de29:
      if (*(int *)param_1 < 2) {
        puVar5 = &DAT_002c79d4;
      }
      else {
        puVar5 = *(undefined1 **)(param_1 + 0x40c);
      }
      Warning("changelevel2 failed: %s not found\n",puVar5);
      return;
    }
    cVar1 = CL_IsHL2Demo();
    if (cVar1 != '\0') {
      pcVar3 = "";
      if (1 < *(int *)param_1) {
        pcVar3 = *(char **)(param_1 + 0x40c);
      }
      iVar2 = _V_stricmp(pcVar3,"d1_trainstation_03");
      if (iVar2 != 0) {
        pcVar3 = "";
        if (1 < *(int *)param_1) {
          pcVar3 = *(char **)(param_1 + 0x40c);
        }
        iVar2 = _V_stricmp(pcVar3,"d1_town_02a");
        if (iVar2 != 0) goto LAB_0017de29;
      }
    }
  }
  pcVar3 = "";
  if (1 < *(int *)param_1) {
    pcVar3 = *(char **)(param_1 + 0x40c);
  }
  cVar1 = CL_HL2Demo_MapCheck(pcVar3);
  if (cVar1 == '\0') {
    if (*(int *)param_1 < 2) {
      puVar5 = &DAT_002c79d4;
    }
    else {
      puVar5 = *(undefined1 **)(param_1 + 0x40c);
    }
    Warning("changelevel failed: %s not found\n",puVar5);
    return;
  }
  SetLaunchOptions(param_1);
  if (*(int *)param_1 < 3) {
    pcVar3 = "";
    if (*(int *)param_1 != 2) {
      pcVar4 = "";
      goto LAB_0017de69;
    }
  }
  else {
    pcVar3 = *(char **)(param_1 + 0x410);
  }
  pcVar4 = *(char **)(param_1 + 0x40c);
LAB_0017de69:
  HostState_ChangeLevelSP(pcVar4,pcVar3);
  return;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)