Skip to content

Commit

Permalink
Changed jHeretic: Speed+Use no longer skips an inventory item. The co…
Browse files Browse the repository at this point in the history
…ntrol binding system can now be used to replicate this functionality if desired. Removed command line option "-artiskip", obsolete.

Changed jHexen: Speed+Use no longer skips an inventory item. The control binding system now be used to replicate this functionality if desired. Removed command line option "-noartiskip", obsolete.
  • Loading branch information
danij committed May 5, 2009
1 parent a459f5b commit 2a8b35a
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 45 deletions.
38 changes: 13 additions & 25 deletions doomsday/plugins/common/src/g_controls.c
Expand Up @@ -840,35 +840,23 @@ static void G_UpdateCmdControls(ticcmd_t *cmd, int pnum,
// Use artifact key
if(PLAYER_ACTION(pnum, A_USEARTIFACT))
{
if(PLAYER_ACTION(pnum, A_SPEED) && invSkipParam)
if(Hu_InventoryIsOpen())
{
if(plr->inventory[plr->invPtr].type != IIT_NONE)
{
PLAYER_ACTION(pnum, A_USEARTIFACT) = false;

cmd->arti = 0xff;
}
}
else
{
if(Hu_InventoryIsOpen())
{
plr->readyItem = plr->inventory[plr->invPtr].type;

Hu_InventoryOpen(plr - players, false); // close the inventory
plr->readyItem = plr->inventory[plr->invPtr].type;

if(cfg.chooseAndUse)
cmd->arti = plr->inventory[plr->invPtr].type;
else
cmd->arti = 0;
Hu_InventoryOpen(plr - players, false); // close the inventory

usearti = false;
}
else if(usearti)
{
if(cfg.chooseAndUse)
cmd->arti = plr->inventory[plr->invPtr].type;
usearti = false;
}
else
cmd->arti = 0;

usearti = false;
}
else if(usearti)
{
cmd->arti = plr->inventory[plr->invPtr].type;
usearti = false;
}
}
#endif
Expand Down
21 changes: 7 additions & 14 deletions doomsday/plugins/common/src/p_user.c
Expand Up @@ -1840,24 +1840,17 @@ void P_PlayerThinkUpdateControls(player_t* player)
brain->useInvItem = false;
if(P_GetImpulseControlState(playerNum, CTL_USE_ITEM))
{
if(brain->speed && invSkipParam)
// If the inventory is visible, close it (depending on cfg.chooseAndUse).
if(Hu_InventoryIsOpen(player - players))
{
brain->cycleInvItem = -1;
Hu_InventoryOpen(player - players, false); // close the inventory

if(cfg.inventoryUseImmediate)
brain->useInvItem = true;
}
else
{
// If the inventory is visible, close it (depending on cfg.chooseAndUse).
if(Hu_InventoryIsOpen(player - players))
{
Hu_InventoryOpen(player - players, false); // close the inventory

if(cfg.inventoryUseImmediate)
brain->useInvItem = true;
}
else
{
brain->useInvItem = true;
}
brain->useInvItem = true;
}
}

Expand Down
1 change: 0 additions & 1 deletion doomsday/plugins/jheretic/include/h_main.h
Expand Up @@ -42,7 +42,6 @@ extern boolean noMonstersParm;
extern boolean respawnParm;
extern boolean turboParm;
extern boolean fastParm;
extern boolean invSkipParam;

extern float turboMul;
extern skillmode_t startSkill;
Expand Down
2 changes: 0 additions & 2 deletions doomsday/plugins/jheretic/src/h_main.c
Expand Up @@ -76,7 +76,6 @@ boolean noMonstersParm; // checkparm of -nomonsters
boolean respawnParm; // checkparm of -respawn
boolean turboParm; // checkparm of -turbo
boolean fastParm; // checkparm of -fast
boolean invSkipParam; // whether shift-enter skips an inventory item

float turboMul; // multiplier for turbo

Expand Down Expand Up @@ -472,7 +471,6 @@ void G_PostInit(void)
noMonstersParm = ArgCheck("-nomonsters");
respawnParm = ArgCheck("-respawn");
devParm = ArgCheck("-devparm");
invSkipParam = !(ArgCheck("-noartiskip"));

if(ArgCheck("-deathmatch"))
{
Expand Down
1 change: 0 additions & 1 deletion doomsday/plugins/jhexen/include/x_main.h
Expand Up @@ -37,7 +37,6 @@ extern boolean respawnParm; // checkparm of -respawn
extern boolean turboParm; // checkparm of -turbo
extern boolean randomClassParm; // checkparm of -randclass
extern boolean devParm; // checkparm of -devparm
extern boolean invSkipParam; // Whether shift-enter skips an inventory item.
extern float turboMul; // Multiplier for turbo.

extern int gameModeBits;
Expand Down
2 changes: 0 additions & 2 deletions doomsday/plugins/jhexen/src/h2_main.c
Expand Up @@ -91,7 +91,6 @@ boolean respawnParm; // checkparm of -respawn
boolean turboParm; // checkparm of -turbo
boolean randomClassParm; // checkparm of -randclass
boolean devParm; // checkparm of -devparm
boolean invSkipParam; // Whether shift-enter skips an inventory item.

float turboMul; // Multiplier for turbo.
boolean netCheatParm; // Allow cheating in netgames (-netcheat)
Expand Down Expand Up @@ -496,7 +495,6 @@ static void handleArgs(void)
respawnParm = ArgExists("-respawn");
randomClassParm = ArgExists("-randclass");
devParm = ArgExists("-devparm");
invSkipParam = ArgExists("-artiskip");
netCheatParm = ArgExists("-netcheat");

cfg.netDeathmatch = ArgExists("-deathmatch");
Expand Down

0 comments on commit 2a8b35a

Please sign in to comment.