Skip to content

Commit

Permalink
Merge branch 'bugfix-#5'
Browse files Browse the repository at this point in the history
  • Loading branch information
redomar committed Sep 1, 2014
2 parents 885634a + d515536 commit b078b8b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/com/redomar/game/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public class Game extends Canvas implements Runnable {
private static int steps;
private static boolean devMode;
private static boolean closingMode;
private static boolean isAzertyCountry;

private static JFrame frame;

Expand Down Expand Up @@ -307,12 +306,18 @@ public void render() {
print.print("Teleported into new world", PrintTypes.GAME);
if (getMap() == 1) {
setMap("/levels/water_level.png");
getLevel().removeEntity(getDummy()); setNpc(false);
if(getDummy()!=null){ // Gave nullPointerException(); upon entering new world.
getLevel().removeEntity(getDummy());
setNpc(false);
}
getLevel().removeEntity(getVendor());
setMap(2);
} else if (getMap() == 2) {
setMap("/levels/custom_level.png");
getLevel().removeEntity(getDummy()); setNpc(false);
if(getDummy()!=null){
getLevel().removeEntity(getDummy());
setNpc(false);
}
getLevel().addEntity(getVendor());
setMap(1);
}
Expand Down

0 comments on commit b078b8b

Please sign in to comment.