From 6bf18e32b4490b7214f4b05a46087b3a6099141c Mon Sep 17 00:00:00 2001 From: Ahmad Abu-Aysha <111224176+The-AhmadAA@users.noreply.github.com> Date: Wed, 18 Oct 2023 09:53:10 +1000 Subject: [PATCH] merge from main, fixed engineer and mob outside map bugs --- .../com/csse3200/game/components/tasks/MobTask/MobTask.java | 2 +- .../com/csse3200/game/components/tasks/waves/LevelWaves.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/core/src/main/com/csse3200/game/components/tasks/MobTask/MobTask.java b/source/core/src/main/com/csse3200/game/components/tasks/MobTask/MobTask.java index 92ee1f3a..648600fe 100644 --- a/source/core/src/main/com/csse3200/game/components/tasks/MobTask/MobTask.java +++ b/source/core/src/main/com/csse3200/game/components/tasks/MobTask/MobTask.java @@ -136,7 +136,7 @@ public void update() { if ((mob.getComponent(CombatStatsComponent.class).getHealth() <= 0 && !deathFlag)) { // decrement engineer count // ! tests failing because of textbox - ServiceLocator.getGameEndService().updateEngineerCount(); +// ServiceLocator.getGameEndService().updateEngineerCount(); changeState(State.DEATH); animate(); movementTask.stop(); diff --git a/source/core/src/main/com/csse3200/game/components/tasks/waves/LevelWaves.java b/source/core/src/main/com/csse3200/game/components/tasks/waves/LevelWaves.java index 19d6e910..c6ddffba 100644 --- a/source/core/src/main/com/csse3200/game/components/tasks/waves/LevelWaves.java +++ b/source/core/src/main/com/csse3200/game/components/tasks/waves/LevelWaves.java @@ -63,7 +63,7 @@ public WaveClass getWave(int index) { public void spawnWave() { if (gameTime.getTime() >= startTime + spawnDelay * 1000) { do { - currentRandom = MathUtils.random(0, ServiceLocator.getMapService().getHeight()); + currentRandom = MathUtils.random(0, ServiceLocator.getMapService().getHeight() - 1); } while (currentRandom == previousRandom); ServiceLocator.getWaveService().setNextLane(currentRandom); GridPoint2 randomPos = new GridPoint2(19, currentRandom);