View Issue Details

IDProjectCategoryView StatusLast Update
0002884FSSCPmodelspublic2013-07-09 05:16
ReporterMjnMixael Assigned Tom_m  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformPCOSWindowsOS VersionWin7
Product Version3.7.0 RC2 
Summary0002884: Team colors not displayed on player ship.
DescriptionIf the player selects a ship that has Team Colors enabled in the ships.tbl, the team colors will not be displayed in-mission when externally viewing the player ship.

They do display in the tech room, lab, ship select, and on AI-controlled ships.
Steps To ReproduceUse the attached mod and play this Team Colors Test mission.
Select the Loki as your ship (note in the ship select that it has green all over it).
Start the mission and externally view your fighter.
No Team Colors.
TagsNo tags attached.

Activities

MjnMixael

2013-06-03 14:01

manager  

00 Mantis Sandbox.7z (58,576 bytes)

m_m

2013-06-22 20:55

developer   ~0015140

Last edited: 2013-06-22 20:56

The cause of this bug is that the team name of a ship wasn't updated when the ship type was changed. The attached patch fixes that but may introduce some new behavior.

m_m

2013-06-22 20:55

developer  

mantis2884.patch (1,414 bytes)   
Index: code/ship/ship.cpp
===================================================================
--- code/ship/ship.cpp	(revision 9697)
+++ code/ship/ship.cpp	(working copy)
@@ -9342,6 +9342,11 @@
 			}
 		}
 	}
+
+	if (sip->uses_team_colors)
+	{
+		sp->team_name = sip->default_team_name;
+	}
 }
 
 #ifndef NDEBUG
@@ -15218,12 +15223,12 @@
 		weapon_info	*wip;
 		int bank=swp->current_secondary_bank;
 		if (swp->secondary_bank_weapons[bank] >= 0) {
-			wip = &Weapon_info[swp->secondary_bank_weapons[bank]];
-			if ( swp->secondary_bank_ammo[bank] > 0 ) {
-				srange = wip->max_speed * wip->lifetime;
-			}
+		wip = &Weapon_info[swp->secondary_bank_weapons[bank]];
+		if ( swp->secondary_bank_ammo[bank] > 0 ) {
+			srange = wip->max_speed * wip->lifetime;
 		}
 	}
+	}
 
 	return srange;
 }
@@ -15252,15 +15257,15 @@
 int get_max_ammo_count_for_bank(int ship_class, int bank, int ammo_type)
 {
 	float capacity, size;
-    
+
 	if (ship_class < 0 || bank < 0 || ammo_type < 0) {
 		return 0;
 	} else {
-		capacity = (float) Ship_info[ship_class].secondary_bank_ammo_capacity[bank];
-		size = (float) Weapon_info[ammo_type].cargo_size;
-		return (int) (capacity / size);
-	}
+	capacity = (float) Ship_info[ship_class].secondary_bank_ammo_capacity[bank];
+	size = (float) Weapon_info[ammo_type].cargo_size;
+	return (int) (capacity / size);
 }
+}
 
 /**
  * Page in bitmaps for all the ships in this level
mantis2884.patch (1,414 bytes)   

MjnMixael

2013-07-07 20:04

manager   ~0015168

This seems to fix the issue.

The_E

2013-07-08 17:14

administrator   ~0015177

Looks good to me

m_m

2013-07-09 05:16

developer   ~0015179

Fix committed to trunk@9720.

Related Changesets

fs2open: trunk r9720

2013-07-09 02:21

m_m


Ported: N/A

Details Diff
Fix for Mantis 2884: Team colors not displayed on player ship. Affected Issues
0002884
mod - /trunk/fs2_open/code/ship/ship.cpp Diff File

Issue History

Date Modified Username Field Change
2013-06-03 13:58 MjnMixael New Issue
2013-06-03 14:01 MjnMixael File Added: 00 Mantis Sandbox.7z
2013-06-22 20:55 m_m Note Added: 0015140
2013-06-22 20:55 m_m Assigned To => m_m
2013-06-22 20:55 m_m Status new => code review
2013-06-22 20:55 m_m File Added: mantis2884.patch
2013-06-22 20:56 m_m Note Edited: 0015140
2013-07-07 20:04 MjnMixael Note Added: 0015168
2013-07-08 17:14 The_E Note Added: 0015177
2013-07-09 05:16 m_m Changeset attached => fs2open trunk r9720
2013-07-09 05:16 m_m Note Added: 0015179
2013-07-09 05:16 m_m Status code review => resolved
2013-07-09 05:16 m_m Resolution open => fixed