Skip to content
Snippets Groups Projects
Commit 7fe32476 authored by zalavari's avatar zalavari
Browse files

Resolved bug, which caused the moveable to stay alive

Moveable was able to interact, if we opened a hole beneath it, and
deleted from the Main. But it wasn't deleted from the field itself, so
the field thought there is something on it. Solved it with calling
dropMoveable() from the kill() method.
parent 17ffb0e6
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,7 @@ public class Crate extends Moveable { ...@@ -12,6 +12,7 @@ public class Crate extends Moveable {
*/ */
public void kill() { public void kill() {
Main.deleteCrate(this); Main.deleteCrate(this);
super.kill();
} }
/**Ha a láda célmezőre került, akkor kerül meghívásra ez a függvény. /**Ha a láda célmezőre került, akkor kerül meghívásra ez a függvény.
......
...@@ -21,7 +21,7 @@ public abstract class Moveable { ...@@ -21,7 +21,7 @@ public abstract class Moveable {
* A Moveable elveszik és nem vesz részt a további játékban. * A Moveable elveszik és nem vesz részt a további játékban.
*/ */
public void kill() { public void kill() {
if (myField!=null) myField.dropMoveable();
} }
//Ezek a függvények szándékosan üresek, csak a kiírást végzik //Ezek a függvények szándékosan üresek, csak a kiírást végzik
......
...@@ -57,6 +57,7 @@ public class Worker extends Moveable { ...@@ -57,6 +57,7 @@ public class Worker extends Moveable {
public void kill() { public void kill() {
force=0; force=0;
alive=false; alive=false;
super.kill();
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment