View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003027 | FSSCP | AI | public | 2014-04-05 15:55 | 2014-04-05 15:59 |
Reporter | m_m | Assigned To | m_m | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.7.1 | ||||
Target Version | 3.7.2 | ||||
Summary | 0003027: Crash if ship AI is forced to change target | ||||
Description | If a ship targets a subsystem and is forced to change the target by e.g. ignoring the set target can result in crash if the target change happens within the target delay time. | ||||
Steps To Reproduce | Have a bomber target a capital ship subsystem and then ignore that ship when the bomber arrives in the mission. | ||||
Additional Information | The uploaded patch fixes the crash by making sure that the return value of set_target_objnum is used when setting the new En_objp pointer. | ||||
Tags | No tags attached. | ||||
|
aiCrash.patch (575 bytes)
Index: code/ai/aicode.cpp =================================================================== --- code/ai/aicode.cpp (revision 10551) +++ code/ai/aicode.cpp (working copy) @@ -14014,8 +14014,12 @@ if (target_objnum != -1) { if (aip->target_objnum != target_objnum) aip->aspect_locked_time = 0.0f; - set_target_objnum(aip, target_objnum); - En_objp = &Objects[target_objnum]; + target_objnum = set_target_objnum(aip, target_objnum); + + if (target_objnum >= 0) + { + En_objp = &Objects[target_objnum]; + } } } } |
|
Fix committed to trunk@10552. |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-04-05 15:55 | m_m | New Issue | |
2014-04-05 15:55 | m_m | Status | new => assigned |
2014-04-05 15:55 | m_m | Assigned To | => m_m |
2014-04-05 15:55 | m_m | File Added: aiCrash.patch | |
2014-04-05 15:56 | m_m | Status | assigned => code review |
2014-04-05 15:59 | m_m | Changeset attached | => fs2open trunk r10552 |
2014-04-05 15:59 | m_m | Note Added: 0015697 | |
2014-04-05 15:59 | m_m | Status | code review => resolved |
2014-04-05 15:59 | m_m | Resolution | open => fixed |