Fixes BuilderAI & RepairAI retreat nullpointers (#4681)

* Update BuilderAI.java

* Update RepairAI.java
This commit is contained in:
Patrick 'Quezler' Mounier
2021-02-15 15:31:27 +01:00
committed by GitHub
parent fa52255d04
commit 557e5710cd
2 changed files with 2 additions and 2 deletions

View File

@@ -53,7 +53,7 @@ public class BuilderAI extends AIController{
if((retreatTimer += Time.delta) >= retreatDelay){
if(enemy != null){
var core = unit.closestCore();
if(!unit.within(core, retreatDst)){
if(core != null && !unit.within(core, retreatDst)){
moveTo(core, retreatDst);
}
}

View File

@@ -45,7 +45,7 @@ public class RepairAI extends AIController{
//fly away from enemy when not doing anything
if(avoid != null){
var core = unit.closestCore();
if(!unit.within(core, retreatDst)){
if(core != null && !unit.within(core, retreatDst)){
moveTo(core, retreatDst);
}
}