View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002659 | FSSCP | HUD | public | 2012-05-28 14:52 | 2012-11-20 00:28 |
Reporter | Mastadon | Assigned To | iss_mneur | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | N/A | OS | N/A | ||
Product Version | 3.6.14 RC5 | ||||
Summary | 0002659: Pressing the "target nearest attacker" selects a non-attacking-but-hostile target | ||||
Description | When 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 Reproduce | 1. Open up the attached mission file using FSO 3.6.14 RC5. 2. Press "R". | ||||
Tags | No tags attached. | ||||
has duplicate | 0002154 | closed | Goober5000 | Unarmed ships getting targeted by 'R' |
|
|
|
hudtarget.cpp.patch (1,056 bytes)
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) { |
|
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. |
|
Fix committed to trunk@8842. |
|
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 |
|
See my comments at: http://www.hard-light.net/forums/index.php?topic=80906.msg1614149#msg1614149 |
|
MjnMixael says that revision 8848 fixed all outstanding issues with this ticket. |
|
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. |
|
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. |
Date Modified | Username | Field | Change |
---|---|---|---|
2012-05-28 14:52 | Mastadon | New Issue | |
2012-05-28 14:52 | Mastadon | File Added: targetDistanceTest.fs2 | |
2012-05-28 15:54 | Mastadon | File Added: hudtarget.cpp.patch | |
2012-05-28 15:58 | Mastadon | Note Added: 0013618 | |
2012-06-01 02:06 | iss_mneur | Changeset attached | => fs2open trunk r8842 |
2012-06-01 02:06 | iss_mneur | Note Added: 0013621 | |
2012-06-01 02:06 | iss_mneur | Status | new => resolved |
2012-06-01 02:06 | iss_mneur | Resolution | open => fixed |
2012-06-05 16:13 | Goober5000 | Note Added: 0013633 | |
2012-06-05 16:13 | Goober5000 | Assigned To | => iss_mneur |
2012-06-05 16:13 | Goober5000 | Status | resolved => code review |
2012-06-05 16:13 | Goober5000 | Resolution | fixed => reopened |
2012-06-05 19:12 | Mastadon | Note Added: 0013634 | |
2012-06-11 05:11 | Goober5000 | Note Added: 0013658 | |
2012-06-11 05:11 | Goober5000 | Status | code review => resolved |
2012-06-11 05:11 | Goober5000 | Resolution | reopened => fixed |
2012-08-27 15:18 | chief1983 | Note Added: 0013947 | |
2012-08-28 04:28 | chief1983 | Note Added: 0013948 | |
2012-08-28 04:51 | chief1983 | Note Edited: 0013948 | |
2012-11-20 00:28 | Goober5000 | Relationship added | has duplicate 0002154 |