Skip to content

Commit

Permalink
Fix a buffer issue in server_changelevel forward caused by engine_cha…
Browse files Browse the repository at this point in the history
…ngelevel native (#503)
  • Loading branch information
Arkshine committed Jul 24, 2018
1 parent 98ab266 commit a9ce39d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions amxmodx/amxmodx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2615,11 +2615,11 @@ static cell AMX_NATIVE_CALL change_task(AMX *amx, cell *params)
static cell AMX_NATIVE_CALL engine_changelevel(AMX *amx, cell *params)
{
int length;
const char* new_map = get_amxstring(amx, params[1], 0, length);
ke::AString new_map(get_amxstring(amx, params[1], 0, length));

// Same as calling "changelevel" command but will trigger "server_changelevel" AMXX forward as well.
// Filling second param will call "changelevel2" command, but this is not usable in multiplayer game.
g_pEngTable->pfnChangeLevel(new_map, NULL);
g_pEngTable->pfnChangeLevel(new_map.chars(), NULL);

return 1;
}
Expand Down

0 comments on commit a9ce39d

Please sign in to comment.