From 11f81070f26ec13cb0580ea932d371b0a61fe775 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sun, 22 Feb 2015 19:31:11 +0000 Subject: [PATCH] Lunatic: fix a couple of typo-like issues found by listglobals.sh. DONT_BUILD. git-svn-id: https://svn.eduke32.com/eduke32@5026 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/lunatic/bcheck.lua | 2 +- polymer/eduke32/source/lunatic/defs.ilua | 5 +++-- polymer/eduke32/source/lunatic/engine_maptext.lua | 2 ++ polymer/eduke32/source/lunatic/lunacon.lua | 4 ++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/polymer/eduke32/source/lunatic/bcheck.lua b/polymer/eduke32/source/lunatic/bcheck.lua index f41ab5a92..0eec78df3 100644 --- a/polymer/eduke32/source/lunatic/bcheck.lua +++ b/polymer/eduke32/source/lunatic/bcheck.lua @@ -111,7 +111,7 @@ function bcheck.quote_idx(qnum, onlyidx) return cstr end -function bcheck.top_level(funcname) +function bcheck.top_level(funcname, errlev) if (ffiC.g_elCallDepth > 0) then error("Invalid use of "..funcname..": must be called from top level", errlev or 3) end diff --git a/polymer/eduke32/source/lunatic/defs.ilua b/polymer/eduke32/source/lunatic/defs.ilua index 62c0ca626..ead94f1eb 100644 --- a/polymer/eduke32/source/lunatic/defs.ilua +++ b/polymer/eduke32/source/lunatic/defs.ilua @@ -21,6 +21,7 @@ local getmetatable = getmetatable local ipairs = ipairs local loadstring = loadstring local pairs = pairs +local pcall = pcall local rawget = rawget local rawset = rawset local select = select @@ -943,7 +944,7 @@ end function actor_static_members.move(i, vec, cliptype, clipdist) check_sprite_idx(i) local vel = ivec3(vec.x, vec.y, vec.z) - return ffiC.A_MoveSpriteClipdist(spritenum, vel, cliptype, clipdist or -1) + return ffiC.A_MoveSpriteClipdist(i, vel, cliptype, clipdist or -1) end -- Delete sprite with index . @@ -2049,7 +2050,7 @@ local function animate_all_sprites() end -function check_arg_number(name, argpos, val) +local function check_arg_number(name, argpos, val) if (type(val) ~= "number") then errorf(3, "invalid '%s' argument (#%d) to gameactor: must be a number", name, argpos) end diff --git a/polymer/eduke32/source/lunatic/engine_maptext.lua b/polymer/eduke32/source/lunatic/engine_maptext.lua index b7c9142fc..afe55e378 100644 --- a/polymer/eduke32/source/lunatic/engine_maptext.lua +++ b/polymer/eduke32/source/lunatic/engine_maptext.lua @@ -4,6 +4,8 @@ local ffi = require("ffi") local ffiC = ffi.C +local assert = assert +local loadstring = loadstring local pairs = pairs local pcall = pcall local print = print diff --git a/polymer/eduke32/source/lunatic/lunacon.lua b/polymer/eduke32/source/lunatic/lunacon.lua index fd02834c0..f830ea022 100644 --- a/polymer/eduke32/source/lunatic/lunacon.lua +++ b/polymer/eduke32/source/lunatic/lunacon.lua @@ -1372,7 +1372,7 @@ function Cmd.xspriteflags(tilenum, flags, override) end -- Mark the last 'spriteflags' or 'sprite*' directive for the given actor. - g_code.aflagsloc[tilenum] = getLocation(format("'%s' for actor", g_lastkw), pos) + g_code.aflagsloc[tilenum] = getLocation(format("'%s' for actor", g_lastkw)) if (ffi and ok) then local tile = ffiC.g_tile[tilenum] @@ -3892,7 +3892,7 @@ function parse(contents) -- local end end - function compare_gv(gva, gvb) + local function compare_gv(gva, gvb) if (gva.loc[1] ~= gvb.loc[1]) then return gva.loc[1] < gvb.loc[1] end