Commit 56018e7f authored by Drahomír Karchňák's avatar Drahomír Karchňák

Merge branch '759-nullpointerexception' into 'V3.5.1'

#759 Fixed object being in wrong difficulty, that would cause NPE on missing assets.

See merge request !582
parents 253c7cf8 d0ca138d
......@@ -70,7 +70,7 @@ public class GameObject extends Group implements Action.ActionListener {
public void onActionDrop(Action action, int collidesWithNumber) {
if (collidesWithNumber != Action.NO_COLLISION_NUMBER) {
// FIXME: 10/30/17 why to store action number if using ordinal?
if (!crimeSceneGame.isActionAdded(action)) actionsStripWidget.addSelectedAction(GameObjectType.values()[action.getActionNumber()].getActionTexturePath(), collidesWithNumber, crimeSceneGame, action.getActionNumber());
if (!actionsStripWidget.isNotFull()) crimeSceneGame.getStartButton().setEnabled(true);
......
......@@ -171,7 +171,6 @@ public class LevelDefinition {
//EASY 4
levelsDefinition[3][GameObjectType.BOX.getActionNumber()] = new Position(150,150);
levelsDefinition[3][GameObjectType.BROKEN_GLASS.getActionNumber()] = new Position(300,250);
levelsDefinition[3][GameObjectType.CLOCK_2.getActionNumber()] = new Position(740,210);
levelsDefinition[3][GameObjectType.CREAK_FLOOR_2.getActionNumber()] = new Position(600,200);
levelsDefinition[3][GameObjectType.MARBLE.getActionNumber()] = new Position(400,200);
levelsDefinition[3][GameObjectType.MOUSE_1.getActionNumber()] = new Position(50,230);
......@@ -293,6 +292,7 @@ public class LevelDefinition {
levelsDefinition[8][GameObjectType.PHONE_TALK.getActionNumber()] = new Position(200,200);
levelsDefinition[8][GameObjectType.PHONE_RING.getActionNumber()] = new Position(300,200);
levelsDefinition[8][GameObjectType.STAMP.getActionNumber()] = new Position(250,100);
levelsDefinition[8][GameObjectType.CLOCK_2.getActionNumber()] = new Position(710,245);
levelsDefinition[8][GameObjectType.WINDOW_3.getActionNumber()] = new Position(600,400);
levelsDefinition[8][GameObjectType.BUCKET_2.getActionNumber()] = new Position(500,300);
levelsDefinition[8][GameObjectType.DOOR_2.getActionNumber()] = new Position(100,278);
......@@ -302,18 +302,19 @@ public class LevelDefinition {
levelsDefinition[8][GameObjectType.STAIRS_2.getActionNumber()] = new Position(300,332);
//HARD 2
levelsDefinition[9][GameObjectType.BOOKS.getActionNumber()] = new Position(650,200);
levelsDefinition[9][GameObjectType.BOOKS.getActionNumber()] = new Position(620,205);
levelsDefinition[9][GameObjectType.TYPEWRITER_TYPING_ALT.getActionNumber()] = new Position(200,100);
levelsDefinition[9][GameObjectType.TYPEWRITER_TYPING_FAST.getActionNumber()] = new Position(650,100);
levelsDefinition[9][GameObjectType.TYPEWRITER_TYPING_NORMAL.getActionNumber()] = new Position(300,300);
levelsDefinition[9][GameObjectType.CURTAIN_2.getActionNumber()] = new Position(200,375);
levelsDefinition[9][GameObjectType.SAFE_2.getActionNumber()] = new Position(800,185);
levelsDefinition[9][GameObjectType.SAFE_2.getActionNumber()] = new Position(760,135);
//common 1,2
levelsDefinition[9][GameObjectType.INKPOT.getActionNumber()] = new Position(530,170);
levelsDefinition[9][GameObjectType.PHONE_HANGUP.getActionNumber()] = new Position(100,200);
levelsDefinition[9][GameObjectType.PHONE_TALK.getActionNumber()] = new Position(200,200);
levelsDefinition[9][GameObjectType.PHONE_RING.getActionNumber()] = new Position(300,200);
levelsDefinition[9][GameObjectType.STAMP.getActionNumber()] = new Position(350,50);
levelsDefinition[9][GameObjectType.CLOCK_2.getActionNumber()] = new Position(860,205);
levelsDefinition[9][GameObjectType.WINDOW_3.getActionNumber()] = new Position(800,350);
levelsDefinition[9][GameObjectType.BUCKET_2.getActionNumber()] = new Position(450,300);
levelsDefinition[9][GameObjectType.DOOR_2.getActionNumber()] = new Position(100,258);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment