diff --git a/polymer/eduke32/source/lunatic/bcheck.lua b/polymer/eduke32/source/lunatic/bcheck.lua index 41f07fd50..41471a7ab 100644 --- a/polymer/eduke32/source/lunatic/bcheck.lua +++ b/polymer/eduke32/source/lunatic/bcheck.lua @@ -64,13 +64,13 @@ end function bcheck.volume_idx(volume) if (volume >= con_lang.MAXVOLUMES+0ULL) then - error("invalid volume number "..volume) + error("invalid volume number "..volume, 3) end end function bcheck.level_idx(level) if (level >= con_lang.MAXLEVELS+0ULL) then - error("invalid level number "..level) + error("invalid level number "..level, 3) end end diff --git a/polymer/eduke32/source/lunatic/defs.ilua b/polymer/eduke32/source/lunatic/defs.ilua index dc1d47543..ac71f25b7 100644 --- a/polymer/eduke32/source/lunatic/defs.ilua +++ b/polymer/eduke32/source/lunatic/defs.ilua @@ -711,7 +711,7 @@ end local player_static_members = {} -player_static_members.INPUT_BITS = defs_c.conststruct +player_static_members._INPUT_BITS = defs_c.conststruct { JUMP = 1, CROUCH = 2, @@ -744,7 +744,7 @@ player_static_members.INPUT_BITS = defs_c.conststruct ESC = 2147483648, } -player_static_members.INPUT_EXT_BITS = defs_c.conststruct +player_static_members._INPUT_EXT_BITS = defs_c.conststruct { MOVE_FORWARD = 1, MOVE_BACKWARD = 2, @@ -905,8 +905,8 @@ local actor_mt = { end, -- count - set_count = function(a) - ffi.cast(actor_ptr_ct, a).t_data[0] = 0 + set_count = function(a, count) + ffi.cast(actor_ptr_ct, a).t_data[0] = count end, get_count = function(a) @@ -1183,8 +1183,10 @@ local user_defs_mt = { end, set_volume_number = function(ud, volume_number) - -- NOTE: volume_number==MAXVOLUMES disallowed. - bcheck.volume_idx(volume_number) + -- NOTE: allow volume_number==MAXVOLUMES. + if (not (volume_number==con_lang.MAXVOLUMES)) then + bcheck.volume_idx(volume_number) + end ud.volume_number = volume_number end, diff --git a/polymer/eduke32/source/lunatic/test.elua b/polymer/eduke32/source/lunatic/test.elua index 7435860b1..41a79b89e 100644 --- a/polymer/eduke32/source/lunatic/test.elua +++ b/polymer/eduke32/source/lunatic/test.elua @@ -192,7 +192,7 @@ gameevent("PROCESSINPUT", -- Input test. -- NOTE: I don't think that exposing g_player[].sync (aka "input") is a good idea... function(actori, playeri, dist) - local IB = player.INPUT_BITS + local IB = player._INPUT_BITS local input = player[playeri]._input if (bit.band(input.bits, IB.JUMP) ~= 0) then print("JUMPED")