From 84a126253a1580cd041e42b8c78d7671abadb092 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 6 May 2018 21:35:59 -0400 Subject: [PATCH] Fixed player looking at cursor with no ammo --- core/src/io/anuke/mindustry/entities/Player.java | 2 +- core/src/io/anuke/mindustry/game/TeamInfo.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/io/anuke/mindustry/entities/Player.java b/core/src/io/anuke/mindustry/entities/Player.java index 805d398a72..f23062f44f 100644 --- a/core/src/io/anuke/mindustry/entities/Player.java +++ b/core/src/io/anuke/mindustry/entities/Player.java @@ -263,7 +263,7 @@ public class Player extends Unit{ movement.y += ya*speed; movement.x += xa*speed; - boolean shooting = control.input().canShoot() && control.input().isShooting(); + boolean shooting = control.input().canShoot() && control.input().isShooting() && inventory.hasAmmo(); if(shooting){ weapon.update(player, true); diff --git a/core/src/io/anuke/mindustry/game/TeamInfo.java b/core/src/io/anuke/mindustry/game/TeamInfo.java index e6ea8d90e3..7400363bdf 100644 --- a/core/src/io/anuke/mindustry/game/TeamInfo.java +++ b/core/src/io/anuke/mindustry/game/TeamInfo.java @@ -29,8 +29,7 @@ public class TeamInfo { /**Register a team. * @param team The team type enum. * @param ally Whether this team is an ally with the player or an enemy with the player. - * In PvP situations with dedicated servers, the sides can be arbitrary. - */ + * In PvP situations with dedicated servers, the sides can be arbitrary.*/ public void add(Team team, boolean ally){ if(has(team)) throw new RuntimeException("Can't define team information twice!");