diff --git a/src/p_spec.cpp b/src/p_spec.cpp index 35ed13306..d0d972448 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -602,6 +602,16 @@ DEFINE_ACTION_FUNCTION(AActor, GiveSecret) return 0; } +DEFINE_ACTION_FUNCTION(FLevelLocals, GiveSecret) +{ + PARAM_PROLOGUE; + PARAM_OBJECT(activator, AActor); + PARAM_BOOL_DEF(printmessage); + PARAM_BOOL_DEF(playsound); + P_GiveSecret(activator, printmessage, playsound, -1); + return 0; +} + //============================================================================ // // P_PlayerOnSpecialFlat diff --git a/wadsrc/static/zscript/base.txt b/wadsrc/static/zscript/base.txt index 4be135118..e3f453fca 100644 --- a/wadsrc/static/zscript/base.txt +++ b/wadsrc/static/zscript/base.txt @@ -530,6 +530,7 @@ struct LevelLocals native native int GetUDMFInt(int type, int index, Name key); native double GetUDMFFloat(int type, int index, Name key); native bool ExecuteSpecial(int special, Actor activator, line linedef, bool lineside, int arg1 = 0, int arg2 = 0, int arg3 = 0, int arg4 = 0, int arg5 = 0); + native static void GiveSecret(Actor activator, bool printmsg = true, bool playsound = true); native static void StartSlideshow(Name whichone = 'none'); native static void WorldDone(); native static void RemoveAllBots(bool fromlist); diff --git a/wadsrc/static/zscript/shared/secrettrigger.txt b/wadsrc/static/zscript/shared/secrettrigger.txt index c60399600..7a2a78ef4 100644 --- a/wadsrc/static/zscript/shared/secrettrigger.txt +++ b/wadsrc/static/zscript/shared/secrettrigger.txt @@ -17,7 +17,7 @@ class SecretTrigger : Actor override void Activate (Actor activator) { - activator.GiveSecret(args[0] <= 1, (args[0] == 0 || args[0] == 2)); + Level.GiveSecret(activator, args[0] <= 1, (args[0] == 0 || args[0] == 2)); Destroy (); }