View Issue Details

IDProjectCategoryView StatusLast Update
0002370FSSCPgameplaypublic2012-02-13 21:09
ReporterDroid803 Assigned Toniffiwan  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.6.13 
Summary0002370: Respawn error if player is not on first starting wing
DescriptionIf the player is not the first starting wing (ie. is on Beta wing, not Alpha wing), restarting the mission results in the player's starting wing not being present.

This is causes debug to crash with "Int3(): From g:\fso\fs2_open_0\code\freespace2\freespace.cpp at line 3751", as FSO cannot find the object to place the camera on.

Probably better error catching is in order, tell people in FRED that the player isn't on the first starting wing or something (or make it not mattter).
Additional InformationAttached mission runs on vanilla FSO, simply restart the mission and Debug will crash to desktop without any error message at all.
TagsNo tags attached.

Relationships

related to 0002465 closedniffiwan Alpha wing disappears after player dies and restarts 

Activities

2011-01-04 20:03

 

respawn_crash.fs2 (3,588 bytes)

niffiwan

2012-01-26 15:38

developer  

mantis2370.patch (1,212 bytes)   
diff --git a/fs2_open/code/mission/missionparse.cpp b/fs2_open/code/mission/missionparse.cpp
index 0e6c1f3..7703a46 100644
--- a/fs2_open/code/mission/missionparse.cpp
+++ b/fs2_open/code/mission/missionparse.cpp
@@ -4418,6 +4418,27 @@ void post_process_ships_wings()
 		Error(LOCATION, "The first starting wing and the first team-versus-team wing must have the same wing name.\n");
 	}
 
+	// niffiwan - sanity check starting wings
+	if (wing_name_lookup(Starting_wing_names[0], 1) == -1)
+	{
+		Error(LOCATION, "You must define the first starting wing '%s'. If you don't want this wing name, use '$Starting wing names' in the mission file.\n",Starting_wing_names[0]);
+	}
+	int last_wing_ok = 1;
+	for (i = 1; i < MAX_STARTING_WINGS; i++ )
+	{
+		if (wing_name_lookup(Starting_wing_names[i], 1) == -1)
+		{
+			last_wing_ok = 0;
+		}
+		else
+		{
+			if (last_wing_ok == 0)
+			{
+				Error(LOCATION, "You skipped defining starting wing '%s'. Create the wing, or use/fix '$Starting wing names' in the mission file.\n",Starting_wing_names[i-1]);
+			}
+		}
+	}
+
 	// Goober5000 - for FRED, the ships are initialized after the wings, so we must now tell the wings
 	// where their ships are
 	if (Fred_running)
mantis2370.patch (1,212 bytes)   

niffiwan

2012-01-26 15:43

developer   ~0013164

Could someone please review this patch? I choose to make the mission parser more picky with the starting wings by ensuring that non-defined wings can only exist at the end of the list, not the beginning or the middle. i.e. the example mission no longer parses correctly because Alpha wing is not defined.

To make it parse, add these lines:
$Starting wing names: ( "Beta" )
$Team-versus-team wing names: ( "Beta" )

niffiwan

2012-01-28 11:10

developer   ~0013176

I decided that I didn't like my first patch, so after some more trawling through the code, I've come up with this one. This should let FSO gracefully handle missing wings in $Starting wing names: when restarting a mission

Tests fine vs the example mission.

niffiwan

2012-01-28 11:10

developer   ~0013177

Fix committed to trunk@8383.

Zacam

2012-02-13 21:09

administrator   ~0013298

Fix committed to fs2_open_3_6_14@8470.

Related Changesets

fs2open: trunk r8383

2012-01-28 06:10

niffiwan


Ported: N/A

Details Diff
Fix for mantis 0002370: ignore missing starting wing indexes during mission restart Affected Issues
0002370
mod - /trunk/fs2_open/code/missionui/missionscreencommon.cpp Diff File

fs2open: fs2_open_3_6_14 r8470

2012-02-13 16:09

Zacam


Ported: N/A

Details Diff
Backport: Trunk r8383; Fix for mantis 0002370: ignore missing starting wing indexes during mission restart Affected Issues
0002370
mod - /branches/fs2_open_3_6_14/code/missionui/missionscreencommon.cpp Diff File

Issue History

Date Modified Username Field Change
2011-01-04 20:03 Droid803 New Issue
2011-01-04 20:03 Droid803 File Added: respawn_crash.fs2
2012-01-24 21:15 niffiwan Relationship added related to 0002465
2012-01-24 21:15 niffiwan Assigned To => niffiwan
2012-01-24 21:15 niffiwan Status new => assigned
2012-01-26 15:38 niffiwan File Added: mantis2370.patch
2012-01-26 15:43 niffiwan Note Added: 0013164
2012-01-26 15:43 niffiwan Status assigned => code review
2012-01-28 11:10 niffiwan Note Added: 0013176
2012-01-28 11:10 niffiwan Changeset attached => fs2open trunk r8383
2012-01-28 11:10 niffiwan Note Added: 0013177
2012-01-28 11:10 niffiwan Status code review => resolved
2012-01-28 11:10 niffiwan Resolution open => fixed
2012-02-13 21:09 Zacam Changeset attached => fs2open fs2_open_3_6_14 r8470
2012-02-13 21:09 Zacam Note Added: 0013298