Commit 0076cdb
authored
Fix 'ignore if dead' flag (scp-fs2open#7509)
* Fix 'ignore if dead' flag
Fixes scp-fs2open#7508.
The subsystem flag "ignore if dead" that many mods use is supposed to "prevent homing weapons from attempting to hit the now destroyed submodel and instead tells them to home on the main hull of the target."
Though, in actuality, the code makes the weapon dumb fire instead of home. This bug means if you destroy a subsystem with this flag, then lock onto it with an aspect weapon and fire the weapon, the weapon will just dumb fire.
With `wp->homing_subsys` cleared as this PR does, the homing code at `weapons.cpp`:5730 falls into its else branch and picks an attack point on the ship body (`ai_big_pick_attack_point / hobjp->pos`) — which is what the flag promises. Javelins, which can only home on engines, will still correctly try to re-acquire another engine in the block just below and drop lock if there's none.
This fix is tested and now the flag works as expected.
* fix for javelins1 parent d4c21ec commit 0076cdb
3 files changed
Lines changed: 21 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
193 | 194 | | |
194 | 195 | | |
195 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
747 | 747 | | |
748 | 748 | | |
749 | 749 | | |
| 750 | + | |
| 751 | + | |
750 | 752 | | |
751 | 753 | | |
752 | 754 | | |
| |||
970 | 972 | | |
971 | 973 | | |
972 | 974 | | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
973 | 978 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5834 | 5834 | | |
5835 | 5835 | | |
5836 | 5836 | | |
5837 | | - | |
5838 | | - | |
| 5837 | + | |
| 5838 | + | |
| 5839 | + | |
| 5840 | + | |
| 5841 | + | |
| 5842 | + | |
| 5843 | + | |
| 5844 | + | |
| 5845 | + | |
| 5846 | + | |
| 5847 | + | |
| 5848 | + | |
| 5849 | + | |
| 5850 | + | |
| 5851 | + | |
5839 | 5852 | | |
5840 | 5853 | | |
5841 | 5854 | | |
| |||
0 commit comments