mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
Lunatic: swap first and second arg of con.spawn().
git-svn-id: https://svn.eduke32.com/eduke32@3939 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
750fbb0a0e
commit
1e26e640e4
6 changed files with 24 additions and 21 deletions
|
@ -265,7 +265,7 @@ function insertsprite(tab_or_tilenum, ...)
|
||||||
check_allnumbers(shade, xrepeat, yrepeat, ang, xvel, zvel, owner)
|
check_allnumbers(shade, xrepeat, yrepeat, ang, xvel, zvel, owner)
|
||||||
|
|
||||||
if (statnum >= ffiC.MAXSTATUS+0ULL) then
|
if (statnum >= ffiC.MAXSTATUS+0ULL) then
|
||||||
error("invalid 'statnum' argument to insertsprite: must be a status number (0 .. MAXSTATUS-1)", 2)
|
error("invalid 'statnum' argument to insertsprite: must be a status number [0 .. MAXSTATUS-1]", 2)
|
||||||
end
|
end
|
||||||
|
|
||||||
A_ResetVarsNextIns()
|
A_ResetVarsNextIns()
|
||||||
|
@ -282,9 +282,9 @@ function _addtodelqueue(spritenum)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- This corresponds to the first (spawn from parent sprite) form of A_Spawn().
|
-- This corresponds to the first (spawn from parent sprite) form of A_Spawn().
|
||||||
function spawn(parentspritenum, tilenum, addtodelqueue)
|
function spawn(tilenum, parentspritenum, addtodelqueue)
|
||||||
check_sprite_idx(parentspritenum)
|
|
||||||
check_tile_idx(tilenum)
|
check_tile_idx(tilenum)
|
||||||
|
check_sprite_idx(parentspritenum)
|
||||||
|
|
||||||
if (addtodelqueue and ffiC.g_spriteDeleteQueueSize == 0) then
|
if (addtodelqueue and ffiC.g_spriteDeleteQueueSize == 0) then
|
||||||
return -1
|
return -1
|
||||||
|
@ -340,7 +340,7 @@ end
|
||||||
local BADGUY_MASK = bit.bor(con_lang.SFLAG.SFLAG_HARDCODED_BADGUY, con_lang.SFLAG.SFLAG_BADGUY)
|
local BADGUY_MASK = bit.bor(con_lang.SFLAG.SFLAG_HARDCODED_BADGUY, con_lang.SFLAG.SFLAG_BADGUY)
|
||||||
|
|
||||||
function isenemytile(tilenum)
|
function isenemytile(tilenum)
|
||||||
return (bit.band(ffiC.g_tile[tilenum].flags, BADGUY_MASK)~=0)
|
return (bit.band(ffiC.g_tile[tilenum]._flags, BADGUY_MASK)~=0)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- The 'rotatesprite' wrapper used by the CON commands.
|
-- The 'rotatesprite' wrapper used by the CON commands.
|
||||||
|
@ -1598,7 +1598,7 @@ function _G_OperateRespawns(tag)
|
||||||
end
|
end
|
||||||
|
|
||||||
if (D.TRANSPORTERSTAR) then
|
if (D.TRANSPORTERSTAR) then
|
||||||
local j = spawn(i, D.TRANSPORTERSTAR)
|
local j = spawn(D.TRANSPORTERSTAR, i)
|
||||||
sprite[j].z = sprite[j].z - (32*256)
|
sprite[j].z = sprite[j].z - (32*256)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -451,7 +451,7 @@ typedef
|
||||||
projectile_t;
|
projectile_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t flags; // XXX: do we want to have this accessible at game time?
|
uint32_t _flags; // XXX: do we want to have this accessible at game time?
|
||||||
const int32_t _cacherange;
|
const int32_t _cacherange;
|
||||||
const projectile_t _defproj;
|
const projectile_t _defproj;
|
||||||
} tiledata_t;
|
} tiledata_t;
|
||||||
|
@ -2069,7 +2069,7 @@ local function our_gameactor(args)
|
||||||
-- Modifying existing behavior is the whole point of chaining after all.
|
-- Modifying existing behavior is the whole point of chaining after all.
|
||||||
-- When soft-replacing, bitwise OR too, emulating CON behavior.
|
-- When soft-replacing, bitwise OR too, emulating CON behavior.
|
||||||
local tile = ffiC.g_tile[tilenum]
|
local tile = ffiC.g_tile[tilenum]
|
||||||
tile.flags = (chainflags==AF.replace_hard) and flags or bit.bor(tile.flags, flags)
|
tile._flags = (chainflags==AF.replace_hard) and flags or bit.bor(tile._flags, flags)
|
||||||
end
|
end
|
||||||
|
|
||||||
local newfunc = replacep and func
|
local newfunc = replacep and func
|
||||||
|
|
|
@ -1102,10 +1102,10 @@ function Cmd.xspriteflags(tilenum, flags)
|
||||||
|
|
||||||
if (ffi and ok) then
|
if (ffi and ok) then
|
||||||
if (type(flags)=="number") then
|
if (type(flags)=="number") then
|
||||||
ffiC.g_tile[tilenum].flags = flags
|
ffiC.g_tile[tilenum]._flags = flags
|
||||||
else
|
else
|
||||||
assert(type(flags)=="string")
|
assert(type(flags)=="string")
|
||||||
ffiC.g_tile[tilenum].flags = bit.bor(ffiC.g_tile[tilenum].flags, ffiC[flags])
|
ffiC.g_tile[tilenum]._flags = bit.bor(ffiC.g_tile[tilenum].flags, ffiC[flags])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2206,19 +2206,19 @@ local Cinner = {
|
||||||
/ "_con._A_DoGuts(_aci,%1,%2)",
|
/ "_con._A_DoGuts(_aci,%1,%2)",
|
||||||
|
|
||||||
spawn = cmd(D)
|
spawn = cmd(D)
|
||||||
/ "_con.spawn(_aci,%1)",
|
/ "_con.spawn(%1,_aci)",
|
||||||
espawn = cmd(D)
|
espawn = cmd(D)
|
||||||
/ "_gv.g_RETURN=_con.spawn(_aci,%1)",
|
/ "_gv.g_RETURN=_con.spawn(%1,_aci)",
|
||||||
espawnvar = cmd(R)
|
espawnvar = cmd(R)
|
||||||
/ "_gv.g_RETURN=_con.spawn(_aci,%1)",
|
/ "_gv.g_RETURN=_con.spawn(%1,_aci)",
|
||||||
qspawn = cmd(D)
|
qspawn = cmd(D)
|
||||||
/ "_con.spawn(_aci,%1,true)",
|
/ "_con.spawn(%1,_aci,true)",
|
||||||
qspawnvar = cmd(R)
|
qspawnvar = cmd(R)
|
||||||
/ "_con.spawn(_aci,%1,true)",
|
/ "_con.spawn(%1,_aci,true)",
|
||||||
eqspawn = cmd(D)
|
eqspawn = cmd(D)
|
||||||
/ "_gv.g_RETURN=_con.spawn(_aci,%1,true)",
|
/ "_gv.g_RETURN=_con.spawn(%1,_aci,true)",
|
||||||
eqspawnvar = cmd(R)
|
eqspawnvar = cmd(R)
|
||||||
/ "_gv.g_RETURN=_con.spawn(_aci,%1,true)",
|
/ "_gv.g_RETURN=_con.spawn(%1,_aci,true)",
|
||||||
|
|
||||||
angoff = cmd(D)
|
angoff = cmd(D)
|
||||||
/ "spriteext[_aci].angoff=%1",
|
/ "spriteext[_aci].angoff=%1",
|
||||||
|
|
|
@ -41,6 +41,9 @@ require "end_gamevars"
|
||||||
-- refer to locals defined prior to the gamevar section in it.
|
-- refer to locals defined prior to the gamevar section in it.
|
||||||
local tag = tag
|
local tag = tag
|
||||||
|
|
||||||
|
local D = require("CON.DEFS")
|
||||||
|
|
||||||
|
|
||||||
gameevent{"JUMP", actor.FLAGS.chain_beg,
|
gameevent{"JUMP", actor.FLAGS.chain_beg,
|
||||||
function(aci, pli)
|
function(aci, pli)
|
||||||
local ps = player[pli]
|
local ps = player[pli]
|
||||||
|
@ -51,7 +54,7 @@ function(aci, pli)
|
||||||
-- Insert MUSICANDSFX sprite with same lo-/hitag as last deleted one.
|
-- Insert MUSICANDSFX sprite with same lo-/hitag as last deleted one.
|
||||||
printf("delmusicsfx: jump count=%d, inserting", ournumjumps)
|
printf("delmusicsfx: jump count=%d, inserting", ournumjumps)
|
||||||
|
|
||||||
local spr = sprite[con.spawn(aci, 5)]
|
local spr = sprite[con.spawn(D.MUSICANDSFX, aci)]
|
||||||
spr.lotag, spr.hitag = tag.lo, tag.hi
|
spr.lotag, spr.hitag = tag.lo, tag.hi
|
||||||
else
|
else
|
||||||
-- Delete nearest MUSICANDSFX sprite.
|
-- Delete nearest MUSICANDSFX sprite.
|
||||||
|
@ -76,7 +79,7 @@ function(aci, pli)
|
||||||
actor.delete(nearesti)
|
actor.delete(nearesti)
|
||||||
end
|
end
|
||||||
|
|
||||||
assert(nearesti < 0 or sprite[nearesti].picnum==5)
|
assert(nearesti < 0 or sprite[nearesti].picnum==D.MUSICANDSFX)
|
||||||
printf("delmusicsfx: jump count=%d, deleting sprite %d", ournumjumps, nearesti)
|
printf("delmusicsfx: jump count=%d, deleting sprite %d", ournumjumps, nearesti)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -117,8 +117,8 @@ gameactor
|
||||||
local circvec = xmath.vec3(0, v.x, 16*v.y):rotate(spr.ang)
|
local circvec = xmath.vec3(0, v.x, 16*v.y):rotate(spr.ang)
|
||||||
local pos = spr^(zofs + radius) + 256*bangvec(spr.ang) + circvec
|
local pos = spr^(zofs + radius) + 256*bangvec(spr.ang) + circvec
|
||||||
|
|
||||||
con.insertsprite{D.TRANSPORTERSTAR+4, pos, spr.sectnum, statnum=actor.STAT.ACTOR,
|
con.insertsprite{D.TRANSPORTERSTAR+4, pos, spr.sectnum, aci, actor.STAT.ACTOR,
|
||||||
xrepeat=3, yrepeat=3, ang=spr.ang, owner=aci}
|
xrepeat=3, yrepeat=3, ang=spr.ang}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
|
@ -5089,7 +5089,7 @@ HORIZONLY:
|
||||||
if (sect >= 0)
|
if (sect >= 0)
|
||||||
yax_getbunches(sect, &cb, &fb);
|
yax_getbunches(sect, &cb, &fb);
|
||||||
|
|
||||||
// this updatesectorz conflicts with Duke3d's way of teleporting through water,
|
// This updatesectorz conflicts with Duke3D's way of teleporting through water,
|
||||||
// so make it a bit conditional... OTOH, this way we have an ugly z jump when
|
// so make it a bit conditional... OTOH, this way we have an ugly z jump when
|
||||||
// changing from above water to underwater
|
// changing from above water to underwater
|
||||||
if (sect >= 0 && !(sector[sect].lotag==ST_1_ABOVE_WATER && p->on_ground && fb>=0))
|
if (sect >= 0 && !(sector[sect].lotag==ST_1_ABOVE_WATER && p->on_ground && fb>=0))
|
||||||
|
|
Loading…
Reference in a new issue