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:
helixhorned 2013-07-09 18:23:41 +00:00
parent 750fbb0a0e
commit 1e26e640e4
6 changed files with 24 additions and 21 deletions

View File

@ -265,7 +265,7 @@ function insertsprite(tab_or_tilenum, ...)
check_allnumbers(shade, xrepeat, yrepeat, ang, xvel, zvel, owner)
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
A_ResetVarsNextIns()
@ -282,9 +282,9 @@ function _addtodelqueue(spritenum)
end
-- This corresponds to the first (spawn from parent sprite) form of A_Spawn().
function spawn(parentspritenum, tilenum, addtodelqueue)
check_sprite_idx(parentspritenum)
function spawn(tilenum, parentspritenum, addtodelqueue)
check_tile_idx(tilenum)
check_sprite_idx(parentspritenum)
if (addtodelqueue and ffiC.g_spriteDeleteQueueSize == 0) then
return -1
@ -340,7 +340,7 @@ end
local BADGUY_MASK = bit.bor(con_lang.SFLAG.SFLAG_HARDCODED_BADGUY, con_lang.SFLAG.SFLAG_BADGUY)
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
-- The 'rotatesprite' wrapper used by the CON commands.
@ -1598,7 +1598,7 @@ function _G_OperateRespawns(tag)
end
if (D.TRANSPORTERSTAR) then
local j = spawn(i, D.TRANSPORTERSTAR)
local j = spawn(D.TRANSPORTERSTAR, i)
sprite[j].z = sprite[j].z - (32*256)
end

View File

@ -451,7 +451,7 @@ typedef
projectile_t;
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 projectile_t _defproj;
} tiledata_t;
@ -2069,7 +2069,7 @@ local function our_gameactor(args)
-- Modifying existing behavior is the whole point of chaining after all.
-- When soft-replacing, bitwise OR too, emulating CON behavior.
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
local newfunc = replacep and func

View File

@ -1102,10 +1102,10 @@ function Cmd.xspriteflags(tilenum, flags)
if (ffi and ok) then
if (type(flags)=="number") then
ffiC.g_tile[tilenum].flags = flags
ffiC.g_tile[tilenum]._flags = flags
else
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
@ -2206,19 +2206,19 @@ local Cinner = {
/ "_con._A_DoGuts(_aci,%1,%2)",
spawn = cmd(D)
/ "_con.spawn(_aci,%1)",
/ "_con.spawn(%1,_aci)",
espawn = cmd(D)
/ "_gv.g_RETURN=_con.spawn(_aci,%1)",
/ "_gv.g_RETURN=_con.spawn(%1,_aci)",
espawnvar = cmd(R)
/ "_gv.g_RETURN=_con.spawn(_aci,%1)",
/ "_gv.g_RETURN=_con.spawn(%1,_aci)",
qspawn = cmd(D)
/ "_con.spawn(_aci,%1,true)",
/ "_con.spawn(%1,_aci,true)",
qspawnvar = cmd(R)
/ "_con.spawn(_aci,%1,true)",
/ "_con.spawn(%1,_aci,true)",
eqspawn = cmd(D)
/ "_gv.g_RETURN=_con.spawn(_aci,%1,true)",
/ "_gv.g_RETURN=_con.spawn(%1,_aci,true)",
eqspawnvar = cmd(R)
/ "_gv.g_RETURN=_con.spawn(_aci,%1,true)",
/ "_gv.g_RETURN=_con.spawn(%1,_aci,true)",
angoff = cmd(D)
/ "spriteext[_aci].angoff=%1",

View File

@ -41,6 +41,9 @@ require "end_gamevars"
-- refer to locals defined prior to the gamevar section in it.
local tag = tag
local D = require("CON.DEFS")
gameevent{"JUMP", actor.FLAGS.chain_beg,
function(aci, pli)
local ps = player[pli]
@ -51,7 +54,7 @@ function(aci, pli)
-- Insert MUSICANDSFX sprite with same lo-/hitag as last deleted one.
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
else
-- Delete nearest MUSICANDSFX sprite.
@ -76,7 +79,7 @@ function(aci, pli)
actor.delete(nearesti)
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)
end

View File

@ -117,8 +117,8 @@ gameactor
local circvec = xmath.vec3(0, v.x, 16*v.y):rotate(spr.ang)
local pos = spr^(zofs + radius) + 256*bangvec(spr.ang) + circvec
con.insertsprite{D.TRANSPORTERSTAR+4, pos, spr.sectnum, statnum=actor.STAT.ACTOR,
xrepeat=3, yrepeat=3, ang=spr.ang, owner=aci}
con.insertsprite{D.TRANSPORTERSTAR+4, pos, spr.sectnum, aci, actor.STAT.ACTOR,
xrepeat=3, yrepeat=3, ang=spr.ang}
end
end
}

View File

@ -5089,7 +5089,7 @@ HORIZONLY:
if (sect >= 0)
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
// changing from above water to underwater
if (sect >= 0 && !(sector[sect].lotag==ST_1_ABOVE_WATER && p->on_ground && fb>=0))