mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-14 01:37:36 +07:00
Fixed mobile crash
This commit is contained in:
@ -88,9 +88,11 @@ public class MobileInput extends InputHandler implements GestureListener{
|
|||||||
|
|
||||||
/** Check and assign targets for a specific position. */
|
/** Check and assign targets for a specific position. */
|
||||||
void checkTargets(float x, float y){
|
void checkTargets(float x, float y){
|
||||||
|
if(player.dead()) return;
|
||||||
|
|
||||||
Unit unit = Units.closestEnemy(player.team(), x, y, 20f, u -> !u.dead);
|
Unit unit = Units.closestEnemy(player.team(), x, y, 20f, u -> !u.dead);
|
||||||
|
|
||||||
if(unit != null && !player.dead() && player.unit().type.canAttack){
|
if(unit != null && player.unit().type.canAttack){
|
||||||
player.unit().mineTile = null;
|
player.unit().mineTile = null;
|
||||||
target = unit;
|
target = unit;
|
||||||
}else{
|
}else{
|
||||||
|
@ -30,6 +30,8 @@ public class ItemsDisplay extends Table{
|
|||||||
top().left();
|
top().left();
|
||||||
margin(0);
|
margin(0);
|
||||||
|
|
||||||
|
if(items == null) return;
|
||||||
|
|
||||||
table(Tex.button, c -> {
|
table(Tex.button, c -> {
|
||||||
c.margin(10).marginLeft(12).marginTop(15f);
|
c.margin(10).marginLeft(12).marginTop(15f);
|
||||||
c.marginRight(12f);
|
c.marginRight(12f);
|
||||||
|
@ -89,7 +89,7 @@ public class LaunchLoadoutDialog extends BaseDialog{
|
|||||||
total.clear();
|
total.clear();
|
||||||
selected.requirements().each(total::add);
|
selected.requirements().each(total::add);
|
||||||
universe.getLaunchResources().each(total::add);
|
universe.getLaunchResources().each(total::add);
|
||||||
valid = sitems.has(total);
|
valid = sitems.has(total) || PlanetDialog.debugSelect;
|
||||||
};
|
};
|
||||||
|
|
||||||
Cons<Table> rebuild = table -> {
|
Cons<Table> rebuild = table -> {
|
||||||
|
Reference in New Issue
Block a user