Fixes BuilderAI & RepairAI retreat nullpointers (#4681)
* Update BuilderAI.java * Update RepairAI.java
This commit is contained in:
committed by
GitHub
parent
fa52255d04
commit
557e5710cd
@@ -53,7 +53,7 @@ public class BuilderAI extends AIController{
|
|||||||
if((retreatTimer += Time.delta) >= retreatDelay){
|
if((retreatTimer += Time.delta) >= retreatDelay){
|
||||||
if(enemy != null){
|
if(enemy != null){
|
||||||
var core = unit.closestCore();
|
var core = unit.closestCore();
|
||||||
if(!unit.within(core, retreatDst)){
|
if(core != null && !unit.within(core, retreatDst)){
|
||||||
moveTo(core, retreatDst);
|
moveTo(core, retreatDst);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class RepairAI extends AIController{
|
|||||||
//fly away from enemy when not doing anything
|
//fly away from enemy when not doing anything
|
||||||
if(avoid != null){
|
if(avoid != null){
|
||||||
var core = unit.closestCore();
|
var core = unit.closestCore();
|
||||||
if(!unit.within(core, retreatDst)){
|
if(core != null && !unit.within(core, retreatDst)){
|
||||||
moveTo(core, retreatDst);
|
moveTo(core, retreatDst);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user