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)
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

View File

@ -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,

View File

@ -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")