View Issue Details

IDProjectCategoryView StatusLast Update
0002246FSSCPgameplaypublic2010-07-25 05:00
ReporterGeneralBattuta Assigned ToEchelon9  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.6.12 RC3 
Summary0002246: Reinforcements menu does not remove unavailable items
DescriptionReinforcement items that are no longer available (because their arrival condition has become false, or their departure cue true) are not removed from the reinforcements list IF other valid items are still present. They remain selectable, though the reinforcement ship/s will not actually arrive.
Additional InformationOnce all the items on the reinforcement list are invalid, the list will be cleared. I will build a test mission and attach it as soon as I can.
TagsNo tags attached.

Activities

2010-07-03 00:41

 

reinforcement bug.fs2 (8,987 bytes)

GeneralBattuta

2010-07-03 00:43

reporter   ~0012172

Uploaded a suave, handsome test mission.

Procedure: start mission. Call in 'Lockout at 5'. Observe that 'Lockout at 1' remains available. Call in 'Lockout at 4', then attempt to call in 'Lockout at 1' but note that it does not actually appear - its availability is an illusion.

'Lockout at 2' should appear to be available, but don't call it in. Call in 'Lockout at 3' to bump the lockout counter up to 3. Observe that 'Lockout at 2' now vanishes since it is the only remaining item and the game 'realizes' it is invalid.

Echelon9

2010-07-10 11:52

developer   ~0012213

I think this is due to a small typo in the mission SEXPs.

The $Arrival Cue: and $Departure Cue: for "lockout at 3" is set incorrectly to 3, when it should be set to 2.

Once this change is made, the reinforcements menu only presents those options which are still available. For instance if you set the reinforcement variable to 3 in the file, and open the mission in game it is only 4 and 5 that appear.

GeneralBattuta

2010-07-11 18:45

reporter   ~0012228

I can't replicate that, even after making the suggested fix. As a demonstration, call in 'Lockout at 5' first; you'll notice that 'Lockout at 1' remains available.

Can you please send me the mission with the correct behavior?

2010-07-24 04:06

 

mantis-2246-fix.diff (1,721 bytes)   
Index: code/hud/hudsquadmsg.cpp
===================================================================
--- code/hud/hudsquadmsg.cpp	(revision 6324)
+++ code/hud/hudsquadmsg.cpp	(working copy)
@@ -2026,7 +2026,7 @@
 // function to display a list of reinforcements available to the player
 void hud_squadmsg_reinforcement_select()
 {
-	int i, k;
+	int i, k, wingnum;
 	reinforcements *rp;
 
 	if ( Num_menu_items == -1 ) {
@@ -2042,7 +2042,32 @@
 			// don't put items which are not on my team
 			if((Player_ship != NULL) && (ship_get_reinforcement_team(i) != Player_ship->team)){
 				continue;
-			} 
+			}
+			
+			//  check the arrival cue sexpression of the ship/wing of this reinforcement.
+			// Goober5000 - if it can't arrive, it doesn't count.  This should check
+			// for SEXP_FALSE as well as SEXP_KNOWN_FALSE, otherwise you end up with
+			// a reinforcement menu containing no valid selections.
+			if ( (wingnum = wing_name_lookup(rp->name, 1)) != -1 ) {
+				Assert ( Wings[wingnum].arrival_cue >= 0 );
+				if ( Sexp_nodes[Wings[wingnum].arrival_cue].value == SEXP_FALSE
+					|| Sexp_nodes[Wings[wingnum].arrival_cue].value == SEXP_KNOWN_FALSE ){
+					continue;
+				}
+			} else {
+				p_object *p_objp;
+				
+				p_objp = mission_parse_get_arrival_ship( rp->name );
+				if ( p_objp != NULL ) {
+					if ( Sexp_nodes[p_objp->arrival_cue].value == SEXP_FALSE
+						|| Sexp_nodes[p_objp->arrival_cue].value == SEXP_KNOWN_FALSE ){
+						continue;
+					}
+				} else {
+					Int3();							// allender says bogus!  reinforcement should be here since it wasn't a wing!
+					continue;
+				}
+			}
 
 			Assert ( Num_menu_items < MAX_MENU_ITEMS );
 			strcpy_s( MsgItems[Num_menu_items].text, rp->name );
mantis-2246-fix.diff (1,721 bytes)   

2010-07-24 04:06

 

Echelon9

2010-07-24 04:07

developer   ~0012266

Attached a patch which adds a check Goober put in elsewhere, to the reinforcements menu logic as well.

Combined with the slightly revised attached mission, I believe this is now working as you wanted.

GeneralBattuta

2010-07-24 04:16

reporter   ~0012267

If I haven't tested this by 24 hours from the time of this post please guillotine me.

GeneralBattuta

2010-07-25 00:51

reporter   ~0012269

Tested. Beautiful. Bug is fixed. Hope this makes 3.6.12!

Echelon9

2010-07-25 05:00

developer   ~0012271

r6325 fixes this.

Issue History

Date Modified Username Field Change
2010-07-02 06:46 GeneralBattuta New Issue
2010-07-03 00:41 GeneralBattuta File Added: reinforcement bug.fs2
2010-07-03 00:43 GeneralBattuta Note Added: 0012172
2010-07-10 11:52 Echelon9 Note Added: 0012213
2010-07-10 12:04 Echelon9 Status new => assigned
2010-07-10 12:04 Echelon9 Assigned To => Echelon9
2010-07-10 12:04 Echelon9 Status assigned => feedback
2010-07-11 18:45 GeneralBattuta Note Added: 0012228
2010-07-24 04:06 Echelon9 File Added: mantis-2246-fix.diff
2010-07-24 04:06 Echelon9 File Added: reinforcement+bug-E9.fs2
2010-07-24 04:07 Echelon9 Note Added: 0012266
2010-07-24 04:16 GeneralBattuta Note Added: 0012267
2010-07-25 00:51 GeneralBattuta Note Added: 0012269
2010-07-25 05:00 Echelon9 Note Added: 0012271
2010-07-25 05:00 Echelon9 Status feedback => resolved
2010-07-25 05:00 Echelon9 Resolution open => fixed