From 00fea6461cd86d4adc0a872e2e7377cb1dac81b1 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Wed, 26 Dec 2012 12:04:44 +0100 Subject: [PATCH] Improved the option to cancel handling events --- classes/PocketMinecraftServer.class.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/classes/PocketMinecraftServer.class.php b/classes/PocketMinecraftServer.class.php index d7c3e6983..358fb1ee9 100644 --- a/classes/PocketMinecraftServer.class.php +++ b/classes/PocketMinecraftServer.class.php @@ -198,7 +198,7 @@ class PocketMinecraftServer extends stdClass{ $this->preparedSQL->selectHandlers->bindValue(":name", $event, SQLITE3_TEXT); $handlers = $this->preparedSQL->selectHandlers->execute(); $result = true; - if($handlers !== false and $handlers !== true){ + if($handlers !== false and $handlers !== true){ while(false !== ($hn = $handlers->fetchArray(SQLITE3_ASSOC)) and $result !== false){ $handler = $this->handlers[(int) $hn["ID"]]; if(is_array($handler)){ @@ -209,8 +209,10 @@ class PocketMinecraftServer extends stdClass{ } } } - $handlers->finalize(); - $this->trigger($event, $data); + $handlers->finalize(); + if($result !== false){ + $this->trigger($event, $data); + } return $result; }