From 734b15e412b72f508d90662b7824f92cf1ba32c9 Mon Sep 17 00:00:00 2001 From: Player701 Date: Sun, 20 Sep 2020 22:46:01 +0300 Subject: [PATCH] Exported FLevelLocals::ChangeLevel to ZScript --- src/g_level.cpp | 11 +++++++++++ wadsrc/static/zscript/base.zs | 1 + 2 files changed, 12 insertions(+) diff --git a/src/g_level.cpp b/src/g_level.cpp index 952c49938..aa6fb013d 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -739,6 +739,17 @@ void FLevelLocals::ChangeLevel(const char *levelname, int position, int inflags, ::nextlevel = nextlevel; } +DEFINE_ACTION_FUNCTION(FLevelLocals, ChangeLevel) +{ + PARAM_SELF_STRUCT_PROLOGUE(FLevelLocals); + PARAM_STRING(levelname); + PARAM_INT(position); + PARAM_INT(inflags); + PARAM_INT(nextSkill); + self->ChangeLevel(levelname, position, inflags, nextSkill); + return 0; +} + //========================================================================== // // diff --git a/wadsrc/static/zscript/base.zs b/wadsrc/static/zscript/base.zs index bd5298cc1..643abc90b 100644 --- a/wadsrc/static/zscript/base.zs +++ b/wadsrc/static/zscript/base.zs @@ -804,6 +804,7 @@ struct LevelLocals native native void ExitLevel(int position, bool keepFacing); native void SecretExitLevel(int position); + native void ChangeLevel(string levelname, int position = 0, int flags = 0, int skill = -1); } struct StringTable native