Fixed player looking at cursor with no ammo
This commit is contained in:
@@ -263,7 +263,7 @@ public class Player extends Unit{
|
|||||||
movement.y += ya*speed;
|
movement.y += ya*speed;
|
||||||
movement.x += xa*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){
|
if(shooting){
|
||||||
weapon.update(player, true);
|
weapon.update(player, true);
|
||||||
|
|||||||
@@ -29,8 +29,7 @@ public class TeamInfo {
|
|||||||
/**Register a team.
|
/**Register a team.
|
||||||
* @param team The team type enum.
|
* @param team The team type enum.
|
||||||
* @param ally Whether this team is an ally with the player or an enemy with the player.
|
* @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){
|
public void add(Team team, boolean ally){
|
||||||
if(has(team)) throw new RuntimeException("Can't define team information twice!");
|
if(has(team)) throw new RuntimeException("Can't define team information twice!");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user