View Issue Details

IDProjectCategoryView StatusLast Update
0002480FSSCPmodelspublic2012-01-23 19:55
ReporterMjnMixael Assigned Toniffiwan  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.6.13 
Fixed in Version3.6.14 
Summary0002480: Secondary bay animation not played.
DescriptionNoticed this with Peterv's Hesat model. The 'claws' open when you switch to that specific weapon bank. However, if you run out of ammo in bank one the game automatically forces you to switch to bank 2. It is in this instance that the animation doesn't play and the 'claws' don't open.
TagsNo tags attached.

Activities

MjnMixael

2012-01-15 21:07

manager  

TEST.7z (973,507 bytes)

MjnMixael

2012-01-15 21:09

manager   ~0013060

This is still broken on latest trunk. Turns out the opposite is true too. If you run out of ammo on the animated bay, when the game auto-switches to a new bay, the claws won't close/animation won't play correctly.

I've uploaded a test 'modpack' to be used with MediaVPs 3612 with the Hesat and a test mission.

niffiwan

2012-01-17 12:21

developer  

mantis-0002480.patch (2,004 bytes)   
Index: fs2_open/code/ship/ship.cpp
===================================================================
--- fs2_open/code/ship/ship.cpp    (revision 8256)
+++ fs2_open/code/ship/ship.cpp    (working copy)
@@ -10395,6 +10395,8 @@ int ship_fire_secondary_detonate(object *obj, ship_weapon *swp)
 
 /**
  * Try to switch to a secondary bank that has ammo
+ *
+ * @note: not currently used - mark for removal? 
  */
 int ship_select_next_valid_secondary_bank(ship_weapon *swp)
 {
@@ -10869,8 +10871,11 @@ done_secondary:
 	//then it would have no firedelay. and then add 250 ms of delay. in effect, this way there is no penalty if there is any firedelay remaning in
 	//the next valid bank. the delay is there to prevent things like Trible/Quad Fire Trebuchets.
 	//
-	if ( (obj->flags & OF_PLAYER_SHIP) && (swp->secondary_bank_ammo[bank] <= 0) ) {
-		if ( ship_select_next_valid_secondary_bank(swp) ) {			//DTP here we switch to the next valid bank, but we can't call weapon_info on next fire_wait
+	// niffiwan: only try to switch banks if object has multiple banks
+	if ( (obj->flags & OF_PLAYER_SHIP) && (swp->secondary_bank_ammo[bank] <= 0) && (swp->num_secondary_banks >= 2) ) {
+		// niffiwan: call ship_select_next_secondary instead of ship_select_next_valid_secondary_bank
+		// ensures all "extras" are dealt with, like animations, scripting hooks, etc
+		if (ship_select_next_secondary(obj) ) {			//DTP here we switch to the next valid bank, but we can't call weapon_info on next fire_wait
 
 			if ( timestamp_elapsed(shipp->weapons.next_secondary_fire_stamp[shipp->weapons.current_secondary_bank]) ) {	//DTP, this is simply a copy of the manual cycle functions
 				shipp->weapons.next_secondary_fire_stamp[shipp->weapons.current_secondary_bank] = timestamp(1000);	//Bumped from 250 to 1000 because some people seem to be to triggerhappy :).
@@ -10881,7 +10886,6 @@ done_secondary:
 				snd_play( &Snds[ship_get_sound(Player_obj, SND_SECONDARY_CYCLE)] );		
 			}
 		}
-
 	}	
 
 	if (has_fired) {
mantis-0002480.patch (2,004 bytes)   

niffiwan

2012-01-17 12:26

developer   ~0013073

MjnMixael - could you please test the attached patch? Let me know if you'd prefer a Windows binary.

MjnMixael

2012-01-17 15:40

manager   ~0013074

Works as expected! Thanks!

niffiwan

2012-01-18 10:09

developer   ~0013076

Fix committed to trunk@8260.

chief1983

2012-01-23 04:52

administrator   ~0013118

Fix committed to fs2_open_3_6_14@8332.

Related Changesets

fs2open: trunk r8260

2012-01-18 05:12

niffiwan


Ported: N/A

Details Diff
Fix for mantis 0002480: when emptying secondary banks use the standard function to select the next bank Affected Issues
0002480
mod - /trunk/fs2_open/code/ship/ship.cpp Diff File

fs2open: fs2_open_3_6_14 r8332

2012-01-22 23:52

chief1983


Ported: N/A

Details Diff
Backport: Trunk 8260; Fix for mantis 0002480: when emptying secondary banks use the standard function... Affected Issues
0002480
mod - /branches/fs2_open_3_6_14/code/ship/ship.cpp Diff File

Issue History

Date Modified Username Field Change
2011-08-05 04:45 MjnMixael New Issue
2012-01-15 21:07 MjnMixael File Added: TEST.7z
2012-01-15 21:09 MjnMixael Note Added: 0013060
2012-01-17 12:21 niffiwan Assigned To => niffiwan
2012-01-17 12:21 niffiwan Status new => assigned
2012-01-17 12:21 niffiwan File Added: mantis-0002480.patch
2012-01-17 12:26 niffiwan Note Added: 0013073
2012-01-17 12:26 niffiwan Status assigned => feedback
2012-01-17 15:40 MjnMixael Note Added: 0013074
2012-01-17 15:40 MjnMixael Status feedback => assigned
2012-01-18 10:09 niffiwan Changeset attached => fs2open trunk r8260
2012-01-18 10:09 niffiwan Note Added: 0013076
2012-01-18 10:09 niffiwan Status assigned => resolved
2012-01-18 10:09 niffiwan Resolution open => fixed
2012-01-23 04:52 chief1983 Changeset attached => fs2open fs2_open_3_6_14 r8332
2012-01-23 04:52 chief1983 Note Added: 0013118
2012-01-23 04:52 chief1983 Assigned To niffiwan => chief1983
2012-01-23 19:55 chief1983 Assigned To chief1983 => niffiwan
2012-01-23 19:55 chief1983 Status resolved => assigned
2012-01-23 19:55 chief1983 Status assigned => resolved
2012-01-23 19:55 chief1983 Fixed in Version => 3.6.14