버그 수정
This commit is contained in:
@@ -258,6 +258,11 @@ abstract class BaseCommand{
|
||||
}
|
||||
|
||||
public function testReservable():?string{
|
||||
if(!$this->isArgValid()){
|
||||
$this->reasonNotReservable = '인자가 올바르지 않습니다.';
|
||||
$this->reservable = false;
|
||||
return $this->reasonNotReservable;
|
||||
}
|
||||
if($this->reservableConstraints === null){
|
||||
return null;
|
||||
}
|
||||
@@ -288,8 +293,10 @@ abstract class BaseCommand{
|
||||
|
||||
public function testRunnable():?string{
|
||||
if(!$this->isArgValid()){
|
||||
throw new \InvalidArgumentException('인자가 제대로 설정되지 않았습니다'.\sammo\Json::encode($this->arg));
|
||||
}
|
||||
$this->reasonNotReservable = '인자가 올바르지 않습니다.';
|
||||
$this->reservable = false;
|
||||
return $this->reasonNotReservable;
|
||||
}
|
||||
if($this->runnableConstraints === null){
|
||||
throw new \InvalidArgumentException('runnableConstraits가 제대로 설정되지 않았습니다');
|
||||
}
|
||||
|
||||
@@ -35,14 +35,14 @@ class che_군량매매 extends Command\GeneralCommand{
|
||||
}
|
||||
$buyRice = boolval($buyRice);
|
||||
$amount = $this->arg['amount']??null;
|
||||
if(is_float($amount)){
|
||||
$amount = Util::toInt($amount);
|
||||
}
|
||||
else if(!is_int($amount)){
|
||||
if(!is_numeric($amount)){
|
||||
return false;
|
||||
}
|
||||
$amount = Util::round($amount, -2);
|
||||
$amount = Util::valueFit($amount, 100, GameConst::$maxResourceActionAmount);
|
||||
|
||||
if($amount <= 0){
|
||||
return false;
|
||||
}
|
||||
$this->arg = [
|
||||
'buyRice'=>$buyRice,
|
||||
'amount'=>$amount
|
||||
|
||||
@@ -43,13 +43,14 @@ class che_증여 extends Command\GeneralCommand{
|
||||
$isGold = $this->arg['isGold'];
|
||||
$amount = $this->arg['amount'];
|
||||
$destGeneralID = $this->arg['destGeneralID'];
|
||||
if(is_float($amount)){
|
||||
$amount = Util::toInt($amount);
|
||||
}
|
||||
else if(!is_int($amount)){
|
||||
if(!is_numeric($amount)){
|
||||
return false;
|
||||
}
|
||||
$amount = Util::round($amount, -2);
|
||||
$amount = Util::valueFit($amount, 100, GameConst::$maxResourceActionAmount);
|
||||
if($amount <= 0){
|
||||
return false;
|
||||
}
|
||||
if(!is_bool($isGold)){
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -38,12 +38,10 @@ class che_헌납 extends Command\GeneralCommand{
|
||||
}
|
||||
$isGold = $this->arg['isGold'];
|
||||
$amount = $this->arg['amount'];
|
||||
if(is_float($amount)){
|
||||
$amount = Util::toInt($amount);
|
||||
}
|
||||
else if(!is_int($amount)){
|
||||
if(!is_numeric($amount)){
|
||||
return false;
|
||||
}
|
||||
$amount = Util::round($amount, -2);
|
||||
$amount = Util::valueFit($amount, 100, GameConst::$maxResourceActionAmount);
|
||||
if(!is_bool($isGold)){
|
||||
return false;
|
||||
|
||||
@@ -44,13 +44,14 @@ class che_몰수 extends Command\NationCommand{
|
||||
$isGold = $this->arg['isGold'];
|
||||
$amount = $this->arg['amount'];
|
||||
$destGeneralID = $this->arg['destGeneralID'];
|
||||
if(is_float($amount)){
|
||||
$amount = Util::toInt($amount);
|
||||
}
|
||||
else if(!is_int($amount)){
|
||||
if(!is_numeric($amount)){
|
||||
return false;
|
||||
}
|
||||
$amount = Util::round($amount, -2);
|
||||
$amount = Util::valueFit($amount, 100, GameConst::$maxResourceActionAmount);
|
||||
if($amount <= 0){
|
||||
return false;
|
||||
}
|
||||
if(!is_bool($isGold)){
|
||||
return false;
|
||||
}
|
||||
@@ -140,8 +141,7 @@ class che_몰수 extends Command\NationCommand{
|
||||
$amount = Util::valueFit(
|
||||
$amount,
|
||||
0,
|
||||
($destGeneral->getVar($resKey) -
|
||||
($isGold?GameConst::$generalMinimumGold:GameConst::$generalMinimumRice))
|
||||
$destGeneral->getVar($resKey)
|
||||
);
|
||||
$amountText = number_format($amount, 0);
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ use function \sammo\{
|
||||
getDomesticExpLevelBonus,
|
||||
CriticalRatioDomestic,
|
||||
CriticalScoreEx,
|
||||
function cutTurn
|
||||
cutTurn
|
||||
};
|
||||
|
||||
use \sammo\Constraint\Constraint;
|
||||
|
||||
@@ -41,13 +41,14 @@ class che_포상 extends Command\NationCommand{
|
||||
$isGold = $this->arg['isGold'];
|
||||
$amount = $this->arg['amount'];
|
||||
$destGeneralID = $this->arg['destGeneralID'];
|
||||
if(is_float($amount)){
|
||||
$amount = Util::toInt($amount);
|
||||
}
|
||||
else if(!is_int($amount)){
|
||||
if(!is_numeric($amount)){
|
||||
return false;
|
||||
}
|
||||
$amount = Util::round($amount, -2);
|
||||
$amount = Util::valueFit($amount, 100, GameConst::$maxResourceActionAmount);
|
||||
if($amount <= 0){
|
||||
return false;
|
||||
}
|
||||
if(!is_bool($isGold)){
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user