diff --git a/hwe/j_myBossInfo.php b/hwe/j_myBossInfo.php index b7b92144..61c09783 100644 --- a/hwe/j_myBossInfo.php +++ b/hwe/j_myBossInfo.php @@ -89,7 +89,7 @@ function do수뇌임명(General $general, int $targetOfficerLevel):?string{ return '임명불가능한 관직입니다.'; } - if(isOfficerSet($chiefSet, $lv)){ + if(isOfficerSet($chiefSet, $targetOfficerLevel)){ return '지금은 임명할 수 없습니다.'; } diff --git a/hwe/sammo/Command/Nation/che_몰수.php b/hwe/sammo/Command/Nation/che_몰수.php index 77e09e16..dbf8bfd6 100644 --- a/hwe/sammo/Command/Nation/che_몰수.php +++ b/hwe/sammo/Command/Nation/che_몰수.php @@ -67,9 +67,6 @@ class che_몰수 extends Command\NationCommand if ($destGeneralID <= 0) { return false; } - if ($destGeneralID == $this->generalObj->getID()) { - return false; - } $this->arg = [ 'isGold' => $isGold, 'amount' => $amount, @@ -106,6 +103,13 @@ class che_몰수 extends Command\NationCommand $env = $this->env; $relYear = $env['year'] - $env['startyear']; + if($this->arg['destGeneralID'] == $this->getGeneral()->getID()){ + $this->fullConditionConstraints=[ + ConstraintHelper::AlwaysFail('본인입니다') + ]; + return; + } + $this->fullConditionConstraints = [ ConstraintHelper::NotBeNeutral(), ConstraintHelper::OccupiedCity(), @@ -222,7 +226,7 @@ class che_몰수 extends Command\NationCommand //TODO: 암행부처럼 보여야... $db = DB::db(); - $destRawGenerals = $db->query('SELECT no,name,officer_level,npc,gold,rice FROM general WHERE nation = %i AND no != %i ORDER BY npc,binary(name)', $this->generalObj->getNationID(), $this->generalObj->getID()); + $destRawGenerals = $db->query('SELECT no,name,officer_level,npc,gold,rice FROM general WHERE nation = %i ORDER BY npc,binary(name)', $this->generalObj->getNationID()); $destGeneralList = []; foreach ($destRawGenerals as $destGeneral) { $nameColor = \sammo\getNameColor($destGeneral['npc']); diff --git a/hwe/sammo/Command/Nation/che_발령.php b/hwe/sammo/Command/Nation/che_발령.php index c496c8be..480848b2 100644 --- a/hwe/sammo/Command/Nation/che_발령.php +++ b/hwe/sammo/Command/Nation/che_발령.php @@ -44,9 +44,6 @@ class che_발령 extends Command\NationCommand{ $destGeneralID = $this->arg['destGeneralID']; $destCityID = $this->arg['destCityID']; - if($destGeneralID == $this->generalObj->getID()){ - return false; - } $this->arg = [ 'destGeneralID'=>$destGeneralID, 'destCityID'=>$destCityID, @@ -71,10 +68,17 @@ class che_발령 extends Command\NationCommand{ protected function initWithArg() { $this->setDestCity($this->arg['destCityID']); - + $destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], null, 1); $this->setDestGeneral($destGeneral); + if($this->arg['destGeneralID'] == $this->getGeneral()->getID()){ + $this->fullConditionConstraints=[ + ConstraintHelper::AlwaysFail('본인입니다') + ]; + return; + } + $this->fullConditionConstraints=[ ConstraintHelper::BeChief(), ConstraintHelper::NotBeNeutral(), @@ -169,7 +173,7 @@ class che_발령 extends Command\NationCommand{ { $db = DB::db(); - $destRawGenerals = $db->query('SELECT no,name,officer_level,npc,gold,rice FROM general WHERE nation = %i AND no != %i ORDER BY npc,binary(name)',$this->generalObj->getNationID(), $this->generalObj->getID()); + $destRawGenerals = $db->query('SELECT no,name,officer_level,npc,gold,rice FROM general WHERE nation = %i ORDER BY npc,binary(name)',$this->generalObj->getNationID()); $destGeneralList = []; foreach($destRawGenerals as $destGeneral){ $nameColor = \sammo\getNameColor($destGeneral['npc']); diff --git a/hwe/sammo/Command/Nation/che_포상.php b/hwe/sammo/Command/Nation/che_포상.php index 9321553a..45090f5c 100644 --- a/hwe/sammo/Command/Nation/che_포상.php +++ b/hwe/sammo/Command/Nation/che_포상.php @@ -64,9 +64,6 @@ class che_포상 extends Command\NationCommand if ($destGeneralID <= 0) { return false; } - if ($destGeneralID == $this->generalObj->getID()) { - return false; - } $this->arg = [ 'isGold' => $isGold, 'amount' => $amount, @@ -95,6 +92,13 @@ class che_포상 extends Command\NationCommand $destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], ['gold', 'rice', 'nation'], 1); $this->setDestGeneral($destGeneral); + if($this->arg['destGeneralID'] == $this->getGeneral()->getID()){ + $this->fullConditionConstraints=[ + ConstraintHelper::AlwaysFail('본인입니다') + ]; + return; + } + $this->fullConditionConstraints = [ ConstraintHelper::NotBeNeutral(), ConstraintHelper::OccupiedCity(), @@ -187,7 +191,7 @@ class che_포상 extends Command\NationCommand //TODO: 암행부처럼 보여야... $db = DB::db(); - $destRawGenerals = $db->query('SELECT no,name,officer_level,npc,gold,rice FROM general WHERE nation = %i AND no != %i ORDER BY npc,binary(name)', $this->generalObj->getNationID(), $this->generalObj->getID()); + $destRawGenerals = $db->query('SELECT no,name,officer_level,npc,gold,rice FROM general WHERE nation = %i ORDER BY npc,binary(name)', $this->generalObj->getNationID()); $destGeneralList = []; foreach ($destRawGenerals as $destGeneral) { $nameColor = \sammo\getNameColor($destGeneral['npc']);