Lunatic: fix a couple of oversights, tweak some stuff.

git-svn-id: https://svn.eduke32.com/eduke32@3843 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-06-01 20:09:42 +00:00
parent e0433e66fb
commit 51ad20eda5
3 changed files with 11 additions and 9 deletions

View file

@ -64,13 +64,13 @@ end
function bcheck.volume_idx(volume) function bcheck.volume_idx(volume)
if (volume >= con_lang.MAXVOLUMES+0ULL) then if (volume >= con_lang.MAXVOLUMES+0ULL) then
error("invalid volume number "..volume) error("invalid volume number "..volume, 3)
end end
end end
function bcheck.level_idx(level) function bcheck.level_idx(level)
if (level >= con_lang.MAXLEVELS+0ULL) then if (level >= con_lang.MAXLEVELS+0ULL) then
error("invalid level number "..level) error("invalid level number "..level, 3)
end end
end end

View file

@ -711,7 +711,7 @@ end
local player_static_members = {} local player_static_members = {}
player_static_members.INPUT_BITS = defs_c.conststruct player_static_members._INPUT_BITS = defs_c.conststruct
{ {
JUMP = 1, JUMP = 1,
CROUCH = 2, CROUCH = 2,
@ -744,7 +744,7 @@ player_static_members.INPUT_BITS = defs_c.conststruct
ESC = 2147483648, ESC = 2147483648,
} }
player_static_members.INPUT_EXT_BITS = defs_c.conststruct player_static_members._INPUT_EXT_BITS = defs_c.conststruct
{ {
MOVE_FORWARD = 1, MOVE_FORWARD = 1,
MOVE_BACKWARD = 2, MOVE_BACKWARD = 2,
@ -905,8 +905,8 @@ local actor_mt = {
end, end,
-- count -- count
set_count = function(a) set_count = function(a, count)
ffi.cast(actor_ptr_ct, a).t_data[0] = 0 ffi.cast(actor_ptr_ct, a).t_data[0] = count
end, end,
get_count = function(a) get_count = function(a)
@ -1183,8 +1183,10 @@ local user_defs_mt = {
end, end,
set_volume_number = function(ud, volume_number) set_volume_number = function(ud, volume_number)
-- NOTE: volume_number==MAXVOLUMES disallowed. -- NOTE: allow volume_number==MAXVOLUMES.
bcheck.volume_idx(volume_number) if (not (volume_number==con_lang.MAXVOLUMES)) then
bcheck.volume_idx(volume_number)
end
ud.volume_number = volume_number ud.volume_number = volume_number
end, end,

View file

@ -192,7 +192,7 @@ gameevent("PROCESSINPUT",
-- Input test. -- Input test.
-- NOTE: I don't think that exposing g_player[].sync (aka "input") is a good idea... -- NOTE: I don't think that exposing g_player[].sync (aka "input") is a good idea...
function(actori, playeri, dist) function(actori, playeri, dist)
local IB = player.INPUT_BITS local IB = player._INPUT_BITS
local input = player[playeri]._input local input = player[playeri]._input
if (bit.band(input.bits, IB.JUMP) ~= 0) then if (bit.band(input.bits, IB.JUMP) ~= 0) then
print("JUMPED") print("JUMPED")