Fixed issue where a ship hits another object that is dead, but it cannot stop combat with it because the hit object is not on the ships target list.

This commit is contained in:
Cekis
2017-01-19 00:03:43 +00:00
parent d21c172115
commit 5d9b21fd46
+8 -1
View File
@@ -49,7 +49,14 @@ public class space_ai extends script.base_script
{
if (ship_ai.isShipDead(target))
{
ship_ai.spaceStopAttack(self, target);
// get my target list and only attempt to remove the target if it's on my list.
obj_id[] targetList = ship_ai.unitGetAttackTargetList(self);
for(obj_id listMember : targetList){
if(listMember.equals(target)){
ship_ai.spaceStopAttack(self, target);
break;
}
}
}
return SCRIPT_CONTINUE;
}