fix: RegNPC 버그 수정, event handler 규격 버그 수정

This commit is contained in:
2021-03-19 18:09:53 +09:00
parent 7a939b7024
commit 911cb614a5
6 changed files with 17 additions and 7 deletions
+10 -1
View File
@@ -407,13 +407,22 @@ class TurnExecutionHelper
}
// 이벤트 핸들러 동작
$e_env = null;
foreach (DB::db()->query('SELECT * from event') as $rawEvent) {
if($e_env === null){
$e_env = $gameStor->getAll(false);
}
$eventID = $rawEvent['id'];
$cond = Json::decode($rawEvent['condition']);
$action = Json::decode($rawEvent['action']);
$event = new Event\EventHandler($cond, $action);
$e_env['currentEventID'] = $eventID;
$event->tryRunEvent(['currentEventID'=>$eventID] + $gameStor->getAll(true));
$event->tryRunEvent($e_env);
}
if($e_env !== null){
$gameStor->resetCache(true);
}
postUpdateMonthly();