2e682e140d
ziplantil reported that in Descent 1, if a player has an empty Vulcan cannon, and no energy, then attempting to fire a weapon would play the SOUND_ALREADY_SELECTED clip every frame until the player ceased trying to fire. The problem does not impact Descent 2 since Descent 2 does not play this sound sample when trying to activate a weapon that is already active. If the current weapon is already LASER_INDEX, then select_primary_weapon(LASER_INDEX) simplifies to: ``` // Pointless, player already using this weapon newdemo_record_player_weapon(LASER_INDEX) if (Primary_weapon != LASER_INDEX) { // skipped, path is false } else { if (wait_for_rearm) // true for this path // Bad, plays every frame digi_play_sample(SOUND_ALREADY_SELECTED); } // Pointless, Primary_weapon already is LASER_INDEX Primary_weapon = LASER_INDEX; if (weapon_name) { // skipped, path is false } ``` Skipping the call avoids two pointless statements, one bad statement, and nothing useful. Therefore, the simplest fix for the problem is to call select_primary_weapon(LASER_INDEX) only if the primary weapon is not currently LASER_INDEX. Reported-by: ziplantil <https://github.com/dxx-rebirth/dxx-rebirth/issues/499> |
||
---|---|---|
.. | ||
2d | ||
3d | ||
arch | ||
editor | ||
main | ||
misc |