diff --git a/core/Script/InvokeScriptCallback.php b/core/Script/InvokeScriptCallback.php index 104aa1c3..e9607fc2 100644 --- a/core/Script/InvokeScriptCallback.php +++ b/core/Script/InvokeScriptCallback.php @@ -8,7 +8,13 @@ use ManiaControl\Callbacks\Structures\Common\BaseResponseStructure; use ManiaControl\General\UsageInformationAble; use ManiaControl\General\UsageInformationTrait; -//TODO test +/** + * Class For Invoking Callbacks on Script Methods + * + * @author ManiaControl Team + * @copyright 2014-2017 ManiaControl Team + * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 + */ class InvokeScriptCallback implements CallbackListener, UsageInformationAble { use UsageInformationTrait; @@ -40,7 +46,7 @@ class InvokeScriptCallback implements CallbackListener, UsageInformationAble { */ public function setCallable(callable $function) { $this->maniaControl->getCallbackManager()->registerCallbackListener($this->callbackName, $this, function(BaseResponseStructure $callBackData) use (&$function){ - if($callBackData == $this->responseId){ + if($callBackData->getResponseId() == $this->responseId){ call_user_func_array($function, array($callBackData)); } }); diff --git a/core/Script/ModeScriptEventManager.php b/core/Script/ModeScriptEventManager.php index 24ad5ba7..c56ab225 100644 --- a/core/Script/ModeScriptEventManager.php +++ b/core/Script/ModeScriptEventManager.php @@ -3,6 +3,7 @@ namespace ManiaControl\Script; use ManiaControl\Callbacks\Callbacks; +use ManiaControl\Callbacks\Structures\ShootMania\OnScoresStructure; use ManiaControl\General\UsageInformationAble; use ManiaControl\General\UsageInformationTrait; use ManiaControl\ManiaControl;