diff --git a/polymer/eduke32/source/gamevars.c b/polymer/eduke32/source/gamevars.c index 218a34e8c..cdbf6da85 100644 --- a/polymer/eduke32/source/gamevars.c +++ b/polymer/eduke32/source/gamevars.c @@ -750,7 +750,7 @@ enum { GVX_BADSECTOR, GVX_BADWALL, GVX_BADINDEX, -} gvxerror_t; +}; static const char *gvxerrs [] ={ "Gv_GetVarX(): invalid gamevar ID", "Gv_GetVarX(): invalid player ID", diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index d91a74bf7..ba45b7d3d 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -2734,9 +2734,7 @@ void P_GetInput(int32_t snum) in.avel = clamp(in.avel, -MAXANGVEL, MAXANGVEL); in.horz = clamp(in.horz, -MAXHORIZ, MAXHORIZ); - j=0; - - for (j = gamefunc_Weapon_1; j <= gamefunc_Weapon_10; j++) + for (j = gamefunc_Weapon_10; j >= gamefunc_Weapon_1; j--) { if (BUTTON(j)) { @@ -2745,14 +2743,14 @@ void P_GetInput(int32_t snum) } } + if (j == gamefunc_Weapon_1-1) + j = 0; + if (BUTTON(gamefunc_Previous_Weapon) || (BUTTON(gamefunc_Dpad_Select) && in.fvel < 0)) j = 11; if (BUTTON(gamefunc_Next_Weapon) || (BUTTON(gamefunc_Dpad_Select) && in.fvel > 0)) j = 12; - if (j > 12) - j = 0; - if (BUTTON(gamefunc_Jump) && p->on_ground) g_emuJumpTics = 4; @@ -2765,8 +2763,7 @@ void P_GetInput(int32_t snum) loc.bits |= BUTTON(gamefunc_Fire)< 0))<curr_weapon, Flags) & WEAPON_SEMIAUTO && BUTTON(gamefunc_Fire)) CONTROL_ClearButton(gamefunc_Fire); - loc.extbits = 0; - loc.extbits |= (BUTTON(gamefunc_Move_Forward) || (in.fvel > 0)); + loc.extbits = (BUTTON(gamefunc_Move_Forward) || (in.fvel > 0)); loc.extbits |= (BUTTON(gamefunc_Move_Backward) || (in.fvel < 0))<<1; loc.extbits |= (BUTTON(gamefunc_Strafe_Left) || (in.svel > 0))<<2; loc.extbits |= (BUTTON(gamefunc_Strafe_Right) || (in.svel < 0))<<3; diff --git a/polymer/eduke32/source/sector.c b/polymer/eduke32/source/sector.c index 93672e912..e73037bcf 100644 --- a/polymer/eduke32/source/sector.c +++ b/polymer/eduke32/source/sector.c @@ -2653,49 +2653,65 @@ CHECKINV1: j = (j == 10 ? -1 : 1); // JBF: prev (-1) or next (1) weapon choice i = 0; - while ((k >= 0 && k < 10) || (PLUTOPAK && k == GROW_WEAPON && (p->subweapon&(1<= 0 && k < 10) || (PLUTOPAK && k == GROW_WEAPON)) { - if (k == GROW_WEAPON) // JBF: this is handling next/previous with the grower selected + // this is handling next/previous with the grower selected + + switch (k) { - if ((int32_t)j == -1) - k = 5; - else k = 7; - } - else - { - k += j; - if (PLUTOPAK) // JBF 20040116: so we don't select grower with v1.3d - if (k == SHRINKER_WEAPON && (p->subweapon&(1<gotweapon & (1 << GROW_WEAPON) && p->ammo_amount[GROW_WEAPON] > 0) + { + k = GROW_WEAPON; + p->subweapon |= (1<subweapon &= ~(1 << GROW_WEAPON); + } + } + else k++; + break; + case GROW_WEAPON: + if ((int32_t)j == -1) + { + if (PLUTOPAK && p->gotweapon & (1 << SHRINKER_WEAPON) && p->ammo_amount[SHRINKER_WEAPON] > 0) + { + k = SHRINKER_WEAPON; + p->subweapon &= ~(1 << GROW_WEAPON); + } + else + k = HANDBOMB_WEAPON; + } + else k = DEVISTATOR_WEAPON; + break; + case SHRINKER_WEAPON: + if ((int32_t)j == 1) + { + if (PLUTOPAK && p->gotweapon & (1 << GROW_WEAPON) && p->ammo_amount[GROW_WEAPON] > 0) + { + k = GROW_WEAPON; + p->subweapon |= (1<gotweapon & (1<ammo_amount[k] > 0) { - if (PLUTOPAK) // JBF 20040116: so we don't select grower with v1.3d - if (k == SHRINKER_WEAPON && (p->subweapon&(1<ammo_amount[GROW_WEAPON] == 0 && - (p->gotweapon & (1<ammo_amount[SHRINKER_WEAPON] > 0) // JBF 20040116: added PLUTOPAK so we don't select grower with v1.3d - { - j = SHRINKER_WEAPON; - p->subweapon &= ~(1<ammo_amount[SHRINKER_WEAPON] == 0 && - (p->gotweapon & (1<ammo_amount[GROW_WEAPON] > 0) // JBF 20040116: added PLUTOPAK so we don't select grower with v1.3d - { - j = GROW_WEAPON; - p->subweapon |= (1<