Skip to content

Commit

Permalink
fix stuck behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiangreffrath committed Sep 13, 2024
1 parent 7a4d166 commit 86c34b5
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/g_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,16 @@ static boolean WeaponSelectable(weapontype_t weapon)
return false;
}

// Can't select the fist if we have the chainsaw, unless
// we also have the berserk pack.

if (demo_compatibility && weapon == wp_fist
&& players[consoleplayer].weaponowned[wp_chainsaw]
&& !players[consoleplayer].powers[pw_strength])
{
return false;
}

return true;
}

Expand Down Expand Up @@ -301,7 +311,10 @@ static int G_NextWeapon(int direction)
i = (i + arrlen(weapon_order_table)) % arrlen(weapon_order_table);
} while (i != start_i && !WeaponSelectable(weapon_order_table[i].weapon));

return weapon_order_table[i].weapon_num;
if (!demo_compatibility)
return weapon_order_table[i].weapon;
else
return weapon_order_table[i].weapon_num;
}

// [FG] toggle demo warp mode
Expand Down

0 comments on commit 86c34b5

Please sign in to comment.