From fea848c48649bdd97ffe168cabdfe2cfd8402ce6 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sun, 31 Aug 2014 11:15:20 +0000 Subject: [PATCH] LunaCON: ignore internal flag in gamevar redef check; allow "Pals" member. git-svn-id: https://svn.eduke32.com/eduke32@4581 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/lunatic/lunacon.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/polymer/eduke32/source/lunatic/lunacon.lua b/polymer/eduke32/source/lunatic/lunacon.lua index c86528757..5baa45393 100644 --- a/polymer/eduke32/source/lunatic/lunacon.lua +++ b/polymer/eduke32/source/lunatic/lunacon.lua @@ -1513,7 +1513,8 @@ function Cmd.gamevar(identifier, initval, flags) end if (ogv ~= nil) then - local oflags = ogv.flags + local oflags = bit.band(ogv.flags, bit.bnot(GVFLAG.CON_PERPLAYER)) + if (oflags ~= flags) then if (bit.band(oflags, GVFLAG.SYSTEM) ~= 0 and not isSessionVar) then -- Attempt to override a system gamevar. See if it's read-only... @@ -1549,7 +1550,7 @@ function Cmd.gamevar(identifier, initval, flags) return end - errprintf("duplicate definition of gamevar `%s' has different flags", identifier) + errprintf("duplicate definition of gamevar `%s' has different flags (new: %x, old: %x)", identifier, flags, oflags) inform.oldgv_location(identifier, true) return else @@ -1908,7 +1909,10 @@ local patt = {} -- will be wrongly accepted at the parsing stage (loogiex is player's member) -- because we don't discriminate between actor and player here. patt.parm2member = lpeg.C(Pat("htg_t") + "loogiex" + "loogiey" + "ammo_amount" + - "weaprecs" + "gotweapon" + "pals" + "max_ammo_amount") * sp1 * tok.rvar + "weaprecs" + "gotweapon" + "pals" + "Pals" + "max_ammo_amount") * sp1 * tok.rvar +-- XXX: "pals" + "Pals": this sucks! It means that we for this list of members +-- requiring second parameters, we will have to enumerate all lower/uppercase +-- instances encountered in the wild. -- The member name must match keywords, too (_all), because e.g. cstat is a -- member of sprite[].