L L4D2node

CVEngineServer::ChangeLevel

0x0022b7e0 · 320 bytes · __thiscall

_ZN14CVEngineServer11ChangeLevelEPKcS1_

Decompiled

undefined (3 params)

/* CVEngineServer::ChangeLevel(char const*, char const*) */

void __thiscall CVEngineServer::ChangeLevel(CVEngineServer *this,char *param_1,char *param_2)

{
  char cVar1;
  int iVar2;
  int in_GS_OFFSET;
  char local_320 [256];
  char local_220 [256];
  char local_120 [256];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (ChangeLevel(char_const*,char_const*)::last_spawncount == DAT_003b8068) goto LAB_0022b8b0;
  ChangeLevel(char_const*,char_const*)::last_spawncount = DAT_003b8068;
  if (param_1 == (char *)0x0) {
    Sys_Error("CVEngineServer::Changelevel with NULL s1\n");
  }
  cVar1 = Cbuf_EscapeCommandArg(param_1,local_220,0x100);
  if (cVar1 == '\0') {
LAB_0022b8d0:
    Warning("Illegal map name in ChangeLevel\n");
  }
  else {
    if (param_2 == (char *)0x0) {
      iVar2 = V_snprintf(local_320,0x100,"changelevel %s\n",local_220);
    }
    else {
      cVar1 = Cbuf_EscapeCommandArg(param_2,local_120,0x100);
      if (cVar1 == '\0') goto LAB_0022b8d0;
      iVar2 = V_snprintf(local_320,0x100,"changelevel2 %s %s\n",local_220,local_120);
    }
    if (iVar2 - 1U < 0xff) {
      Cbuf_AddText(4,local_320,0);
    }
    else {
      Warning("Paramter overflow in ChangeLevel\n");
    }
  }
LAB_0022b8b0:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)