From bf8f4fba522390c6e9b9a2f860ff2fbef091c02d Mon Sep 17 00:00:00 2001 From: Akka <104902222+Akka0@users.noreply.github.com> Date: Mon, 9 May 2022 17:01:08 +0800 Subject: [PATCH] Fix #719 --- .../scripts/service/ScriptMonsterSpawnService.java | 4 ++-- .../scripts/service/ScriptMonsterTideService.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/emu/grasscutter/scripts/service/ScriptMonsterSpawnService.java b/src/main/java/emu/grasscutter/scripts/service/ScriptMonsterSpawnService.java index dda0d4732..0d6baf25d 100644 --- a/src/main/java/emu/grasscutter/scripts/service/ScriptMonsterSpawnService.java +++ b/src/main/java/emu/grasscutter/scripts/service/ScriptMonsterSpawnService.java @@ -28,11 +28,11 @@ public class ScriptMonsterSpawnService { onMonsterCreatedListener.add(consumer); } public void addMonsterDeadListener(Consumer consumer){ - onMonsterCreatedListener.add(consumer); + onMonsterDeadListener.add(consumer); } public void onMonsterDead(EntityMonster entityMonster){ - onMonsterCreatedListener.stream().forEach(l -> l.accept(entityMonster)); + onMonsterDeadListener.forEach(l -> l.accept(entityMonster)); } public void spawnMonster(int groupId, SceneMonster monster) { if(monster == null){ diff --git a/src/main/java/emu/grasscutter/scripts/service/ScriptMonsterTideService.java b/src/main/java/emu/grasscutter/scripts/service/ScriptMonsterTideService.java index 117297f15..3cf186188 100644 --- a/src/main/java/emu/grasscutter/scripts/service/ScriptMonsterTideService.java +++ b/src/main/java/emu/grasscutter/scripts/service/ScriptMonsterTideService.java @@ -66,9 +66,9 @@ public class ScriptMonsterTideService { if(this.monsterTideCount.get() > 0){ // add more this.sceneScriptManager.getScriptMonsterSpawnService().spawnMonster(this.currentGroup.id, getNextMonster()); - }else if(this.monsterAlive.get() == 0){ - // spawn the last turn of monsters - this.sceneScriptManager.callEvent(EventType.EVENT_MONSTER_TIDE_DIE, new ScriptArgs(this.monsterKillCount.get())); } + // spawn the last turn of monsters + // fix the 5-2 + this.sceneScriptManager.callEvent(EventType.EVENT_MONSTER_TIDE_DIE, new ScriptArgs(this.monsterKillCount.get())); } }