mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
LunaCON: add necessary identifier-is-not-gamevar check.
git-svn-id: https://svn.eduke32.com/eduke32@4111 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
bee968a535
commit
937958afef
1 changed files with 9 additions and 2 deletions
|
@ -1494,13 +1494,17 @@ local function thisactor_to_pli(var)
|
|||
return (var=="_aci") and "_pli" or var
|
||||
end
|
||||
|
||||
function lookup.error_not_gamevar(identifier)
|
||||
errprintf("symbol `%s' is not a game variable", identifier)
|
||||
return "_INVALIDGV"
|
||||
end
|
||||
|
||||
-- <aorpvar>: code for actor or player index
|
||||
function lookup.gamevar(identifier, aorpvar, writable)
|
||||
local gv = g_gamevar[identifier]
|
||||
|
||||
if (gv == nil) then
|
||||
errprintf("symbol `%s' is not a game variable", identifier)
|
||||
return "_INVALIDGV"
|
||||
return lookup.error_not_gamevar(identifier)
|
||||
end
|
||||
|
||||
if (writable and bit.band(gv.flags, GVFLAG.READONLY) ~= 0) then
|
||||
|
@ -2099,6 +2103,9 @@ local handle =
|
|||
end
|
||||
|
||||
local gv = g_gamevar[identifier]
|
||||
if (gv == nil) then
|
||||
return lookup.error_not_gamevar(identifier)
|
||||
end
|
||||
|
||||
-- For per-actor or per-player gamevars, the value at the current actor or
|
||||
-- player index gets saved / loaded.
|
||||
|
|
Loading…
Reference in a new issue