mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
Lunatic: keep status number symbols in actor.STAT instead of gv.STAT_*.
git-svn-id: https://svn.eduke32.com/eduke32@3860 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
a57ce255e7
commit
5e5f80d61b
5 changed files with 24 additions and 12 deletions
|
@ -318,17 +318,15 @@ local function shallow_copy(tab)
|
|||
end
|
||||
|
||||
-- KEEPINSYNC with gamedef.c:C_AddDefaultDefinitions() and the respective
|
||||
-- defines. These are exported to the ffi.C namespace and as literal defines
|
||||
-- in lunacon.lua.
|
||||
-- defines. These are exported to the ffi.C namespace (except STAT) and as
|
||||
-- literal defines in lunacon.lua.
|
||||
labels =
|
||||
{
|
||||
STR,
|
||||
PROJ,
|
||||
EVENT,
|
||||
-- setmetatable(
|
||||
shallow_copy(SFLAG),
|
||||
-- { __metatable="noffiC" }),
|
||||
STAT,
|
||||
shallow_copy(SFLAG),
|
||||
setmetatable(STAT, { __metatable="noffiC" }),
|
||||
GAMEFUNC,
|
||||
}
|
||||
|
||||
|
|
|
@ -448,8 +448,10 @@ function _findplayer(pli, spritenum)
|
|||
return 0, A_FP_ManhattanDist(player[pli], sprite[spritenum])
|
||||
end
|
||||
|
||||
local STAT = actor.STAT
|
||||
|
||||
local FN_STATNUMS = {
|
||||
[false] = { con_lang.STAT.STAT_ACTOR },
|
||||
[false] = { STAT.ACTOR },
|
||||
[true] = {},
|
||||
}
|
||||
|
||||
|
@ -1303,7 +1305,7 @@ function _cansee(aci, ps)
|
|||
actor[aci].lastvy = s.y
|
||||
end
|
||||
|
||||
if (can and (spr.statnum==ffiC.STAT_ACTOR or spr.statnum==ffiC.STAT_STANDABLE)) then
|
||||
if (can and (spr.statnum==STAT.ACTOR or spr.statnum==STAT.STANDABLE)) then
|
||||
actor[aci].timetosleep = SLEEPTIME
|
||||
end
|
||||
|
||||
|
@ -1546,7 +1548,7 @@ function _flash(spr, ps)
|
|||
end
|
||||
|
||||
function _G_OperateRespawns(tag)
|
||||
for i in spritesofstat(ffiC.STAT_FX) do
|
||||
for i in spritesofstat(STAT.FX) do
|
||||
local spr = sprite[i]
|
||||
|
||||
if (spr.lotag==tag and spr.picnum==D.RESPAWN) then
|
||||
|
@ -1564,7 +1566,7 @@ function _G_OperateRespawns(tag)
|
|||
end
|
||||
|
||||
function _G_OperateMasterSwitches(tag)
|
||||
for i in spritesofstat(ffiC.STAT_STANDABLE) do
|
||||
for i in spritesofstat(STAT.STANDABLE) do
|
||||
local spr = sprite[i]
|
||||
if (spr.picnum==D.MASTERSWITCH and spr.lotag==tag and spr.yvel==0) then
|
||||
spr:_set_yvel(1)
|
||||
|
|
|
@ -799,6 +799,18 @@ do
|
|||
our_SFLAG.USER_MASK = bit.bor(USER_MASK, our_SFLAG.enemystayput, our_SFLAG.rotfixed)
|
||||
|
||||
actor_static_members.FLAGS = defs_c.conststruct(our_SFLAG)
|
||||
|
||||
-- Sprite status numbers. Kept in 'actor', because it's more of a game-side
|
||||
-- concept (event though status lists are implemented in the engine), and
|
||||
-- to prevent confusion with sprite.CSTAT.
|
||||
local our_STAT = {}
|
||||
|
||||
for name, statnum in pairs(con_lang.STAT) do
|
||||
-- Strip 'STAT_'.
|
||||
our_STAT[name:sub(6)] = statnum
|
||||
end
|
||||
|
||||
actor_static_members.STAT = defs_c.conststruct(our_STAT)
|
||||
end
|
||||
|
||||
-- Delete sprite with index <i>.
|
||||
|
|
|
@ -321,7 +321,7 @@ gameevent(gv.EVENT_ENTERLEVEL,
|
|||
|
||||
-- Make the DUKECAR in E1L1 into a zombie actor (temporarily)
|
||||
if (sprite[24].picnum==2491) then
|
||||
sprite.changestat(24, gv.STAT_ZOMBIEACTOR)
|
||||
sprite.changestat(24, actor.STAT.ZOMBIEACTOR)
|
||||
end
|
||||
|
||||
checkfail("gameevent('GAME', function() print('qwe') end)",
|
||||
|
|
|
@ -54,7 +54,7 @@ function(aci, pli)
|
|||
local nearestdst = Inf
|
||||
local nearesti = -1
|
||||
|
||||
for i in spritesofstat(gv.STAT_FX) do
|
||||
for i in spritesofstat(actor.STAT.FX) do
|
||||
local dst = (sprite[i]-ps.pos):len2()
|
||||
if (nearesti == -1 or (dst < nearestdst and dst < sprite[i].hitag)) then
|
||||
printf("MSFX %d dist %d", i, dst)
|
||||
|
|
Loading…
Reference in a new issue