From 82173b60e2d00d018f39514ae02089b76ed84705 Mon Sep 17 00:00:00 2001 From: Emistry Haoyan Date: Sun, 14 Apr 2019 21:10:43 +0800 Subject: Fix issue #1955 - fix error due to event terminated by GM using `@killmonster` command. --- npc/custom/events/mushroom_event.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'npc/custom') diff --git a/npc/custom/events/mushroom_event.txt b/npc/custom/events/mushroom_event.txt index b9c54c09e..b04b99fff 100644 --- a/npc/custom/events/mushroom_event.txt +++ b/npc/custom/events/mushroom_event.txt @@ -50,9 +50,12 @@ OnMinute10: // Start time (every hour) OnMobKilled: set .Spawn, .Spawn - 1; - getitem .Prize, .Amount; - if (.Spawn) announce "[ "+strcharinfo(PC_NAME)+" ] has killed a Mushroom. There are now "+.Spawn+" Mushroom(s) left.",bc_map; - else { + if (playerattached() != 0) { + getitem .Prize, .Amount; + if (.Spawn) + announce "[ "+strcharinfo(PC_NAME)+" ] has killed a Mushroom. There are now "+.Spawn+" Mushroom(s) left.",bc_map; + } + if (!.Spawn) { announce "The Find the Mushroom Event has ended. All the Mushrooms have been killed.",0; set .status,0; } -- cgit v1.2.3-60-g2f50