View Issue Details

IDProjectCategoryView StatusLast Update
0003110FSSCPHUDpublic2014-09-30 03:27
ReporterMjnMixael Assigned ToMageKing17  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformPCOSWindowsOS VersionWin7
Product Version3.7.2 RC4 
Fixed in Version3.7.2 
Summary0003110: Message Brackets not displayed with 'Invisible to Friendlies' flag
DescriptionYou have a ship in mission. You have checked the box 'Invisible to Friendlies when Stealthed'. The ship is NOT stealthed and can be targeted. If it sends a message, FSO will not draw message brackets around the ship.
Steps To ReproducePlay the attached mission. The Hercules will not get message brackets drawn even though it is specified as the sender of the message.
Additional InformationThis is undesirable behavior because the cause is unclear. 'Invisible to Friendlies when Stealthed' says to me that it will do stuff when the ship is Stealthed and it won't do stuff when it's NOT Stealthed. However this is not the case. In some part of the targeting code, FSO is considering the ship to be Stealthed.
TagsNo tags attached.

Activities

MjnMixael

2014-09-29 15:30

manager  

3110.fs2 (5,176 bytes)

MageKing17

2014-09-29 18:10

developer  

hudtarget.cpp.patch (915 bytes)   
Index: code/hud/hudtarget.cpp
===================================================================
--- code/hud/hudtarget.cpp	(revision 11088)
+++ code/hud/hudtarget.cpp	(working copy)
@@ -3290,7 +3290,11 @@
 
 	// Karajorma - If we've gone to all the trouble to make our friendly ships stealthed they shouldn't then give away 
 	// their position cause they're feeling chatty
-	if ( Ships[Message_shipnum].flags2 & SF2_FRIENDLY_STEALTH_INVIS ) {
+	// MageKing17 - Make the check see if they're actually stealthed at the time, and may as well include a check for
+	// being hidden from sensors, too; logic copied from a similar check in hudescort.cpp
+	if ( (Ships[Message_shipnum].flags & SF_HIDDEN_FROM_SENSORS)
+		|| ((Ships[Message_shipnum].flags2 & SF2_STEALTH) && ((Ships[Message_shipnum].team != Player_ship->team) || (Ships[Message_shipnum].flags2 & SF2_FRIENDLY_STEALTH_INVIS)))
+	) {
 		return;
 	}
 
hudtarget.cpp.patch (915 bytes)   

MageKing17

2014-09-29 18:14

developer   ~0016314

Last edited: 2014-09-29 18:15

Patch uploaded; compiled and tested to fix the issue with the provided mission file. Glancing through the code, there might be other instances of SF2_FRIENDLY_STEALTH_INVIS being used where it assumes the ship is also stealthed at the time. For instance, multi_sexp_deal_with_ship_flag() clears the player's target if they're targeting a ship and you apply SF2_FRIENDLY_STEALTH_INVIS to it... regardless of whether or not it had it before and regardless of whether or not it's stealthed (and regardless of whether or not it's on the same team, even!). Not sure if that fits within the scope of this issue, though.

MjnMixael

2014-09-29 20:23

manager   ~0016315

Yup that works.

Goober5000

2014-09-30 02:52

administrator   ~0016316

Yeah, MageKing17 is correct. SF2_FRIENDLY_STEALTH_INVIS controls what happens when the ship is stealthed; it says nothing about whether the ship currently happens to be stealthed or not.

Goober5000

2014-09-30 03:27

administrator   ~0016317

All issues with friendly-stealth-invisible should now be resolved.

Related Changesets

fs2open: trunk r11095

2014-09-29 23:51

Goober5000


Ported: N/A

Details Diff
MageKing17's patch for Mantis 0003110: Message Brackets not displayed with 'Invisible to Friendlies' flag Affected Issues
0003110
mod - /trunk/fs2_open/code/hud/hudtarget.cpp Diff File

fs2open: trunk r11096

2014-09-30 00:02

Goober5000


Ported: N/A

Details Diff
and on the subject of Mantis 0003110: fix the multi_sexp_deal_with_ship_flag issue that MageKing17 noticed, and tweak a sexp to be more clear Affected Issues
0003110
mod - /trunk/fs2_open/code/parse/sexp.cpp Diff File

Issue History

Date Modified Username Field Change
2014-09-29 15:29 MjnMixael New Issue
2014-09-29 15:30 MjnMixael File Added: 3110.fs2
2014-09-29 18:10 MageKing17 File Added: hudtarget.cpp.patch
2014-09-29 18:14 MageKing17 Note Added: 0016314
2014-09-29 18:14 MageKing17 Assigned To => MageKing17
2014-09-29 18:14 MageKing17 Status new => code review
2014-09-29 18:15 MageKing17 Note Edited: 0016314
2014-09-29 20:23 MjnMixael Note Added: 0016315
2014-09-30 02:52 Goober5000 Note Added: 0016316
2014-09-30 03:14 Goober5000 Changeset attached => fs2open trunk r11095
2014-09-30 03:25 Goober5000 Changeset attached => fs2open trunk r11096
2014-09-30 03:27 Goober5000 Note Added: 0016317
2014-09-30 03:27 Goober5000 Status code review => resolved
2014-09-30 03:27 Goober5000 Resolution open => fixed
2014-09-30 03:27 Goober5000 Fixed in Version => 3.7.2