splitscreen: tweak weapon selection to do the expected thing for shrinker/grower.

git-svn-id: https://svn.eduke32.com/eduke32@2949 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-08-21 17:37:54 +00:00
parent 6953dbd964
commit 5d83f679dd

View file

@ -82,24 +82,39 @@ define GROW_WEAPON 11
// Next and previous weapon actions will never pick the expander. // Next and previous weapon actions will never pick the expander.
onevent EVENT_NEXTWEAPON onevent EVENT_NEXTWEAPON
getplayer[THISACTOR].curr_weapon pweapon getplayer[THISACTOR].curr_weapon pweapon
ifvare pweapon GROW_WEAPON ifvare pweapon HANDBOMB_WEAPON // XXX: HANDREMOTE_WEAPON?
setvar RETURN DEVISTATOR_WEAPON {
getplayer[THISACTOR].subweapon tmp
andvar tmp 0xfffff7ff
setplayer[THISACTOR].subweapon tmp
}
else ifvare pweapon SHRINKER_WEAPON else ifvare pweapon SHRINKER_WEAPON
{
ifvarg player[THISACTOR].ammo_amount GROW_WEAPON 0
setvar RETURN SHRINKER_WEAPON // select expander setvar RETURN SHRINKER_WEAPON // select expander
// else select next weapon
}
endevent endevent
onevent EVENT_PREVIOUSWEAPON onevent EVENT_PREVIOUSWEAPON
getplayer[THISACTOR].curr_weapon pweapon getplayer[THISACTOR].curr_weapon pweapon
ifvare pweapon DEVISTATOR_WEAPON ifvare pweapon DEVISTATOR_WEAPON
{ {
// Select expander. We can't return GROW_WEAPON, because it means ifvarg player[THISACTOR].ammo_amount GROW_WEAPON 0
// 'next weapon' here. {
// Ugly, because the shrinker is displayed for a split second. getplayer[THISACTOR].subweapon tmp
setplayer[THISACTOR].curr_weapon SHRINKER_WEAPON orvar tmp 0x800
setvar RETURN SHRINKER_WEAPON setplayer[THISACTOR].subweapon tmp
// select previous weapon
}
}
ifvare pweapon GROW_WEAPON
{
ifvarg player[THISACTOR].ammo_amount SHRINKER_WEAPON 0
setvar RETURN SHRINKER_WEAPON // select shrinker
// else select previous weapon
} }
else ifvare pweapon GROW_WEAPON
setvar RETURN SHRINKER_WEAPON
endevent endevent
// Disable all the following keys, need room for player 2 // Disable all the following keys, need room for player 2