fix: 이민족 발동 시, 초기 이성이 없으면 동작하지 않도록

This commit is contained in:
Hide_D committed 2023-06-10 22:41:19 +09:00
1 parent 2e6ea3a00d
commit fbac218c34
2 files changed
+31 -17

No files matched your search

+7 -2
View File
@@ -93,8 +93,6 @@ class RaiseInvader extends \sammo\Event\Action
public function run(array $env)
{
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
$gameStor->setValue('isunited', 1);
$npcEachCount = $this->npcEachCount;
@@ -107,6 +105,13 @@ class RaiseInvader extends \sammo\Event\Action
$cities[] = $cityObj;
}
if(!$cities){
return [__CLASS__, 0];
}
$gameStor = KVStorage::getStorage($db, 'game_env');
$gameStor->setValue('isunited', 1);
if ($npcEachCount < 0) {
$npcEachCount =
$db->queryFirstField('SELECT count(no) from general where npc < 4') / count($cities);