Minor Bugfix: Add missing super call, catch potential NullPointer.

This commit is contained in:
Jan Philipp Timme 2014-11-04 20:23:52 +01:00
parent 95f3e05fed
commit c716bc2187
1 changed files with 5 additions and 2 deletions

View File

@ -30,6 +30,7 @@ public class Player extends ShootingEntity implements KeyboardListener {
}
public void update() {
super.update();
if(this.canMove) {
super.update();
int off = 3;
@ -62,8 +63,10 @@ public class Player extends ShootingEntity implements KeyboardListener {
*/
@Override
public void remove() {
if(this.keyboard != null) {
this.keyboard.removeListener(this);
this.keyboard = null;
}
super.remove();
}