버그 수정

This commit is contained in:
2020-04-21 02:06:03 +09:00
parent 6b9157f1d4
commit 3c7bee32f8
13 changed files with 103 additions and 40 deletions
@@ -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
+5 -4
View File
@@ -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;
}
+2 -4
View File
@@ -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;