From f620a28d7421ce27b30e16d25448268c020956bd Mon Sep 17 00:00:00 2001 From: helixhorned Date: Fri, 8 Nov 2013 18:08:42 +0000 Subject: [PATCH] LunaCON: on 'starttrack' with null music, issue a 'soft' error. That is, one that doesn't break the control flow. git-svn-id: https://svn.eduke32.com/eduke32@4142 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/lunatic/control.lua | 16 ++++++---------- polymer/eduke32/source/lunatic/defs.ilua | 2 ++ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/polymer/eduke32/source/lunatic/control.lua b/polymer/eduke32/source/lunatic/control.lua index 0f2f38129..c98eba603 100644 --- a/polymer/eduke32/source/lunatic/control.lua +++ b/polymer/eduke32/source/lunatic/control.lua @@ -1794,8 +1794,12 @@ function _starttrack(level) bcheck.level_idx(level) if (ffiC.G_StartTrack(level) ~= 0) then - error("null music for volume "..ffiC.ud.volume_number.. - " level "..level, 2) + -- Issue a 'soft error', not breaking the control flow. + local errmsg = debug.traceback( + format("null music for volume %d level %d", ffiC.ud.volume_number, level), 2) + errmsg = lprivate.tweak_traceback_msg(errmsg) + ffiC.El_OnError(errmsg) + print("^10error: "..errmsg) end end @@ -1835,18 +1839,10 @@ end -- TODO: saving/restoration of per-player or per-actor gamevars. function _savemapstate() ffiC.G_SaveMapState() - local errmsg = debug.traceback( - "warning: savemapstate: gamevar saving not fully implemented", 2) - ffiC.El_OnError(errmsg) - print(errmsg) end function _loadmapstate() ffiC.G_RestoreMapState() - local errmsg = debug.traceback( - "warning: loadmapstate: gamevar saving not fully implemented", 2) - ffiC.El_OnError(errmsg) - print(errmsg) end -- Gamevar persistence in the configuration file diff --git a/polymer/eduke32/source/lunatic/defs.ilua b/polymer/eduke32/source/lunatic/defs.ilua index 52fcaf0d8..f8a49192b 100644 --- a/polymer/eduke32/source/lunatic/defs.ilua +++ b/polymer/eduke32/source/lunatic/defs.ilua @@ -2234,6 +2234,8 @@ do return errmsg:gsub('%[string "CON"%]:([0-9]+)', transline) end + lprivate.tweak_traceback_msg = tweak_traceback_msg + set_tweak_traceback_internal(tweak_traceback_msg) end