CON: Add "resetplayerflags". Flag 1 means "don't ask the user if they want to load".

git-svn-id: https://svn.eduke32.com/eduke32@5039 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2015-03-04 02:15:15 +00:00
parent 7984d8d6b5
commit b61908cbf3
8 changed files with 24 additions and 14 deletions

View file

@ -99,6 +99,7 @@ static struct { uint32_t keyw; uint32_t date; } g_keywdate[] =
{ CON_UNDEFINELEVEL, 20150208 },
{ CON_IFCUTSCENE, 20150210 },
{ CON_DEFINEVOLUMEFLAGS, 20150222 },
{ CON_RESETPLAYERFLAGS, 20150303 },
};
#endif
@ -561,6 +562,7 @@ const char *keyw[] =
"startcutscene", // 378
"ifcutscene", // 379
"definevolumeflags", // 380
"resetplayerflags", // 381
"<null>"
};
#endif
@ -4183,6 +4185,7 @@ static int32_t C_ParseCommand(int32_t loop)
case CON_SETPLAYERANGLE:
case CON_SETMUSICPOSITION:
case CON_STARTCUTSCENE:
case CON_RESETPLAYERFLAGS:
C_GetNextVar();
continue;

View file

@ -986,6 +986,7 @@ enum ScriptKeywords_t
CON_STARTCUTSCENE, // 378
CON_IFCUTSCENE, // 379
CON_DEFINEVOLUMEFLAGS, // 380
CON_RESETPLAYERFLAGS, // 381
CON_END
};
// KEEPINSYNC with the keyword list in lunatic/con_lang.lua

View file

@ -1034,12 +1034,12 @@ static void VM_Fall(int32_t g_i, spritetype *g_sp)
g_sp->zvel = 0;
}
static int32_t VM_ResetPlayer(int32_t g_p, int32_t g_flags)
static int32_t VM_ResetPlayer(int32_t g_p, int32_t g_flags, int32_t flags)
{
//AddLog("resetplayer");
if (!g_netServer && ud.multimode < 2)
{
if (g_lastSaveSlot >= 0 && ud.recstat != 2)
if (g_lastSaveSlot >= 0 && ud.recstat != 2 && !(flags & 1))
{
M_OpenMenu(g_p);
KB_ClearKeyDown(sc_Space);
@ -3362,11 +3362,14 @@ nullquote:
continue;
case CON_RESETPLAYER:
{
insptr++;
vm.g_flags = VM_ResetPlayer(vm.g_p, vm.g_flags);
}
continue;
vm.g_flags = VM_ResetPlayer(vm.g_p, vm.g_flags, 0);
continue;
case CON_RESETPLAYERFLAGS:
insptr++;
vm.g_flags = VM_ResetPlayer(vm.g_p, vm.g_flags, Gv_GetVarX(*insptr++));
continue;
case CON_IFONWATER:
VM_CONDITIONAL(sector[vm.g_sp->sectnum].lotag == ST_1_ABOVE_WATER && klabs(vm.g_sp->z-sector[vm.g_sp->sectnum].floorz) < (32<<8));
@ -5708,9 +5711,9 @@ void VM_FallSprite(int32_t i)
VM_Fall(i, &sprite[i]);
}
int32_t VM_ResetPlayer2(int32_t snum)
int32_t VM_ResetPlayer2(int32_t snum, int32_t flags)
{
return VM_ResetPlayer(snum, 0);
return VM_ResetPlayer(snum, 0, flags);
}
int32_t VM_CheckSquished2(int32_t i, int32_t snum)

View file

@ -104,7 +104,7 @@ void G_ShowView(int32_t x, int32_t y, int32_t z, int32_t a, int32_t horiz, int32
int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t unbiasedp);
void P_AddWeaponMaybeSwitchI(int32_t snum, int32_t weap);
void VM_FallSprite(int32_t i);
int32_t VM_ResetPlayer2(int32_t snum);
int32_t VM_ResetPlayer2(int32_t snum, int32_t flags);
int32_t VM_CheckSquished2(int32_t i, int32_t snum);
#endif

View file

@ -1028,6 +1028,7 @@ lpeg.P(false) +
"return" +
"respawnhitag" +
"resizearray" +
"resetplayerflags" +
"resetplayer" +
"resetcount" +
"resetactioncount" +

View file

@ -1187,9 +1187,9 @@ function _pkick(ps, spr)
end
end
function _VM_ResetPlayer2(snum)
function _VM_ResetPlayer2(snum, flags)
check_player_idx(snum)
return (CF.VM_ResetPlayer2(snum)~=0)
return (CF.VM_ResetPlayer2(snum, flags)~=0)
end
local PALBITS = { [0]=1, [21]=2, [23]=4 }

View file

@ -2710,7 +2710,9 @@ local Cinner = {
resetcount = cmd()
/ ACS":set_count(0)",
resetplayer = cmd() -- NLCF
/ "if (_con._VM_ResetPlayer2(_pli,_aci)) then _con.longjmp() end",
/ "if (_con._VM_ResetPlayer2(_pli,0)) then _con.longjmp() end",
resetplayerflags = cmd(R) -- NLCF
/ "if (_con._VM_ResetPlayer2(_pli,%1)) then _con.longjmp() end",
respawnhitag = cmd()
/ format("_con._respawnhitag(%s)", SPS""),
tip = cmd()

View file

@ -359,7 +359,7 @@ extern void P_CheckWeaponI(int32_t snum);
extern int32_t A_ShootWithZvel(int32_t i, int32_t atwith, int32_t override_zvel);
extern int32_t A_Spawn(int32_t j, int32_t pn);
extern void VM_FallSprite(int32_t i);
extern int32_t VM_ResetPlayer2(int32_t snum);
extern int32_t VM_ResetPlayer2(int32_t snum, int32_t flags);
extern void A_RadiusDamage(int32_t i, int32_t r, int32_t, int32_t, int32_t, int32_t);
extern void G_OperateSectors(int32_t sn, int32_t ii);
extern void G_OperateActivators(int32_t low,int32_t snum);
@ -410,7 +410,7 @@ DEFINE_VOID_CFUNC(P_CheckWeaponI, ONE_ARG)
DEFINE_RET_CFUNC(A_ShootWithZvel, THREE_ARGS)
DEFINE_RET_CFUNC(A_Spawn, TWO_ARGS)
DEFINE_VOID_CFUNC(VM_FallSprite, ONE_ARG)
DEFINE_RET_CFUNC(VM_ResetPlayer2, ONE_ARG)
DEFINE_RET_CFUNC(VM_ResetPlayer2, TWO_ARGS)
DEFINE_VOID_CFUNC(A_RadiusDamage, LARG(1), LARG(2), LARG(3), LARG(4), LARG(5), LARG(6))
DEFINE_VOID_CFUNC(G_OperateSectors, TWO_ARGS)
DEFINE_VOID_CFUNC(G_OperateActivators, TWO_ARGS)