LunaCON: for readgamevar, if ud.config.scripthandle < 0, keep value, don't err.

git-svn-id: https://svn.eduke32.com/eduke32@4256 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2014-01-12 14:54:34 +00:00
parent 3b1515e51b
commit 8d47e476c7
5 changed files with 9 additions and 5 deletions

View file

@ -1832,6 +1832,7 @@ ACTOR_STATIC void G_MoveStandables(void)
if (s->picnum == TRIPBOMB)
{
// TIMER_CONTROL
if (actor[i].t_data[6] == 1)
{
@ -4680,6 +4681,7 @@ ACTOR_STATIC void G_MoveActors(void)
DETONATEB:
// Pipebomb control set to timer? (see player.c)
// TIMER_CONTROL
if (s->picnum == HEAVYHBOMB && t[6] == 1)
{
/* if(s->extra >= 1)

View file

@ -1882,9 +1882,9 @@ function _savegamevar(name, val)
val, 0, 0);
end
function _readgamevar(name)
function _readgamevar(name, ov)
if (ffiC.ud.config.scripthandle < 0) then
return
return ov
end
assert(type(name)=="string")

View file

@ -38,8 +38,8 @@ local shtab_methods = {
-- Remap consecutive blocks of 16 color indices and return this new shade
-- table.
--
-- <idxs16>: table with idxs16[1] .. idxs16[16] >= 1 and <= 16
-- (i.e. 1-based indices of such 16-tuples)
-- <idxs16>: table with idxs16[0] .. idxs16[15] >= 0 and <= 15
-- (i.e. 0-based indices of such 16-tuples)
--
-- For example, the table
-- { [0]=0,1, 2,3, 5,4, 6,7, 8,13, 10,11, 12,9, 14,15 }

View file

@ -2230,7 +2230,7 @@ local handle =
if (dosave) then
return format("_con._savegamevar(%q,%s)", identifier, code)
else
return format("%s=_con._readgamevar(%q)", code, identifier)
return format("%s=_con._readgamevar(%q,%s)", code, identifier, code)
end
end,

View file

@ -1574,6 +1574,7 @@ int32_t A_ShootWithZvel(int32_t i, int32_t atwith, int32_t override_zvel)
actor[k].t_data[7]=lLifetime
+ mulscale(krand(),lLifetimeVar, 14)
- lLifetimeVar;
// TIMER_CONTROL
actor[k].t_data[6]=1;
}
else
@ -3915,6 +3916,7 @@ static void P_ProcessWeapon(int32_t snum)
actor[j].t_data[7]= ltime
+ mulscale(krand(),lv, 14)
- lv;
// TIMER_CONTROL
actor[j].t_data[6]=1;
}
else actor[j].t_data[6]=2;