2018-06-20 02:37 EDT


View Issue Details Jump to Notes ] Related Changesets ]
IDProjectCategoryView StatusLast Update
0003110FSSCPHUDpublic2014-09-29 23:27
ReporterMjnMixael 
Assigned ToMageKing17 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformPCOSWindowsOS VersionWin7
Product Version3.7.2 RC4 
Target VersionFixed 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.
Attached Files
  • ? file icon 3110.fs2 (5,176 bytes) 2014-09-29 11:30
  • patch file icon hudtarget.cpp.patch (915 bytes) 2014-09-29 14:10 -
    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;
     	}
     
    
    patch file icon hudtarget.cpp.patch (915 bytes) 2014-09-29 14:10 +

-Relationships
+Relationships

-Notes

~0016314

MageKing17 (developer)

Last edited: 2014-09-29 14:15

View 2 revisions

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.

~0016315

MjnMixael (manager)

Yup that works.

~0016316

Goober5000 (administrator)

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.

~0016317

Goober5000 (administrator)

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

+Related Changesets

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