Minor Bugfix: Add missing super call, catch potential NullPointer.
This commit is contained in:
parent
95f3e05fed
commit
c716bc2187
|
@ -30,6 +30,7 @@ public class Player extends ShootingEntity implements KeyboardListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void update() {
|
public void update() {
|
||||||
|
super.update();
|
||||||
if(this.canMove) {
|
if(this.canMove) {
|
||||||
super.update();
|
super.update();
|
||||||
int off = 3;
|
int off = 3;
|
||||||
|
@ -62,8 +63,10 @@ public class Player extends ShootingEntity implements KeyboardListener {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void remove() {
|
public void remove() {
|
||||||
this.keyboard.removeListener(this);
|
if(this.keyboard != null) {
|
||||||
this.keyboard = null;
|
this.keyboard.removeListener(this);
|
||||||
|
this.keyboard = null;
|
||||||
|
}
|
||||||
super.remove();
|
super.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue