fix: 이민족 발동 시, 초기 이성이 없으면 동작하지 않도록
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user