Merge pull request #244 from kkigomi/patch-2

Hook에 Closure를 리스너로 등록할 수 있도록 개선
This commit is contained in:
thisgun
2023-07-10 12:38:34 +09:00
committed by GitHub

View File

@ -19,7 +19,7 @@ Class GML_Hook extends Hook {
$args = $this->getArguments($argsNumber, $args);
if (! ($class && $method) && function_exists($function)) {
if (! ($class && $method) && is_callable($function)) {
return call_user_func_array($function, $args);
} elseif ($obj = call_user_func(array($class, $this->singleton))) {
if ($obj !== false) {
@ -161,4 +161,4 @@ Class GML_Hook extends Hook {
}
}
// end Hook Class;
// end Hook Class;