2018-06-23 10:43 EDT


View Issue Details Jump to Notes ] Related Changesets ]
IDProjectCategoryView StatusLast Update
0002659FSSCPHUDpublic2012-11-19 19:28
ReporterMastadon 
Assigned Toiss_mneur 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformN/AOSN/AOS Version
Product Version3.6.14 RC5 
Target VersionFixed in Version 
Summary0002659: Pressing the "target nearest attacker" selects a non-attacking-but-hostile target
DescriptionWhen you press the "target nearest attacker" key (defaults to "R"), you will instead of selecting a ship that is actually attacking you, select the closest hostile target if that target is closer to you.
Steps To Reproduce1. Open up the attached mission file using FSO 3.6.14 RC5.
2. Press "R".
TagsNo tags attached.
Attached Files
  • ? file icon targetDistanceTest.fs2 (14,151 bytes) 2012-05-28 10:52
  • patch file icon hudtarget.cpp.patch (1,056 bytes) 2012-05-28 11:54 -
    Index: code/hud/hudtarget.cpp
    ===================================================================
    --- code/hud/hudtarget.cpp	(revision 8833)
    +++ code/hud/hudtarget.cpp	(working copy)
    @@ -10,6 +10,7 @@
     
     
     
    +#include "ai/ai.h"
     #include "hud/hud.h"
     #include "hud/hudparse.h"
     #include "hud/hudartillery.h"
    @@ -2089,10 +2090,12 @@
     		}
     	}
     
    +	int initial_attacked_objnum = attacked_objnum;
     	if (attacked_objnum == -1) {
     		attacked_objnum = player_obj_index;
     	}
     
    +
     	// check all turrets if for player.
     	esct.check_all_turrets = (attacked_objnum == player_obj_index);
     	esct.filter = filter;
    @@ -2108,6 +2111,11 @@
     		// fill in rest of esct
     		esct.shipp = shipp;
     
    +			// Filter out any target that is not actually targeting the player  --Mastadon
    +		if ( (initial_attacked_objnum == player_obj_index) && (Ai_info[shipp->ai_index].target_objnum != player_obj_index) ) {
    +			continue;
    +		}
    +
     		// check each shipp on list and update nearest obj and subsys
     		evaluate_ship_as_closest_target(&esct);
     		if (esct.min_distance < min_distance) {
    
    patch file icon hudtarget.cpp.patch (1,056 bytes) 2012-05-28 11:54 +

-Relationships
has duplicate 0002154closedGoober5000 Unarmed ships getting targeted by 'R' 
+Relationships

-Notes

~0013618

Mastadon (reporter)

The hudtarget.cpp.patch file contains a patch that should correct the bug.

NOTE: this fix is extracted from my recent patch (see http://www.hard-light.net/forums/index.php?topic=80906) that causes the "target nearest attacker" key to cycle through all attackers in a manner similar to the "target nearest hostile" key does. As such, this patch should probably not be applied to trunk, since my general feeling is that my patch will be applied to trunk once 3.6.14 is released.

~0013621

iss_mneur (developer)

Fix committed to trunk@8842.

~0013633

Goober5000 (administrator)

This seems to have had unintended side effects. See Mjn.Mixael's post here:
http://www.hard-light.net/forums/index.php?topic=80906.msg1614088#msg1614088

~0013634

Mastadon (reporter)

See my comments at: http://www.hard-light.net/forums/index.php?topic=80906.msg1614149#msg1614149

~0013658

Goober5000 (administrator)

MjnMixael says that revision 8848 fixed all outstanding issues with this ticket.

~0013947

chief1983 (administrator)

Just for clarity, there are actually 4 commits tied to this ticket: 8841, 8842, 8843, and 8848. Most of these commits aren't fixes for this bug, but related to other changes in hostile targeting behavior.

~0013948

chief1983 (administrator)

Last edited: 2012-08-28 00:51

View 2 revisions

Made my own custom version of a test mission, tested Mastadon's patch attached to this ticket specifically against 3.6.14. It does indeed correct this bug. However, if this bug dates back to retail, I'll be apt to let it remain in 3.6.14 for now, and we can discuss a behavior change along with all these other commits in 3.7. It seems to at least go back to 3.6.9, so I'm thinking this will stay the behavior in .14.

+Notes

+Related Changesets

-Issue History
Date Modified Username Field Change
2012-05-28 10:52 Mastadon New Issue
2012-05-28 10:52 Mastadon File Added: targetDistanceTest.fs2
2012-05-28 11:54 Mastadon File Added: hudtarget.cpp.patch
2012-05-28 11:58 Mastadon Note Added: 0013618
2012-05-31 22:06 iss_mneur Changeset attached => fs2open trunk r8842
2012-05-31 22:06 iss_mneur Note Added: 0013621
2012-05-31 22:06 iss_mneur Status new => resolved
2012-05-31 22:06 iss_mneur Resolution open => fixed
2012-06-05 12:13 Goober5000 Note Added: 0013633
2012-06-05 12:13 Goober5000 Assigned To => iss_mneur
2012-06-05 12:13 Goober5000 Status resolved => code review
2012-06-05 12:13 Goober5000 Resolution fixed => reopened
2012-06-05 15:12 Mastadon Note Added: 0013634
2012-06-11 01:11 Goober5000 Note Added: 0013658
2012-06-11 01:11 Goober5000 Status code review => resolved
2012-06-11 01:11 Goober5000 Resolution reopened => fixed
2012-08-27 11:18 chief1983 Note Added: 0013947
2012-08-28 00:28 chief1983 Note Added: 0013948
2012-08-28 00:51 chief1983 Note Edited: 0013948 View Revisions
2012-11-19 19:28 Goober5000 Relationship added has duplicate 0002154
+Issue History