버그 수정

This commit is contained in:
2020-04-25 04:33:53 +09:00
parent 40c89a479f
commit 6d642c8098
12 changed files with 64 additions and 16 deletions
+2
View File
@@ -35,7 +35,9 @@ class che_징병 extends Command\GeneralCommand{
static protected $defaultAtmos;
protected $reqCrew = 0;
/** @var \sammo\GameUnitDetail */
protected $reqCrewType;
/** @var \sammo\GameUnitDetail */
protected $currCrewType;
static protected $isInitStatic = false;
+1 -1
View File
@@ -145,7 +145,7 @@ class che_포상 extends Command\NationCommand{
$logger = $general->getLogger();
$destGeneral->increaseVarWithLimit($resKey, $amount);
$destGeneral->increaseVar($resKey, $amount);
$db->update('nation', [
$resKey=>$db->sqleval('%b - %i', $resKey, $amount)
], 'nation=%i', $nationID);
+1
View File
@@ -681,6 +681,7 @@ class General implements iAction{
$this->rankVarSet = [];
$this->getLogger()->flush();
$this->flushUpdateValues();
return $db->affectedRows() > 0;
}
+25
View File
@@ -3326,6 +3326,31 @@ class GeneralAI
];
}
protected function newChoosePromotion(){
$db = DB::db();
$nation = $this->nation;
$nationID = $nation['nation'];
$minChiefLevel = getNationChiefLevel($nation['level']);
$userChiefCnt = 0;
$strengthSort = [];
$intelSort = [];
foreach(Util::range($minChiefLevel, 12) as $chiefLevel){
if(!key_exists($chiefLevel, $this->chiefGenerals)){
continue;
}
$chief = $this->chiefGenerals[$chiefLevel];
if($chief->getVar('npc') < 2){
$userChiefCnt[$chiefLevel] = $chief;
}
}
}
protected function choosePromotion()
{
$db = DB::db();
+8
View File
@@ -136,4 +136,12 @@ trait LazyVarUpdater{
}
return $updateVals;
}
function flushUpdateValues():void {
$this->updatedVar = [];
if(key_exists('auxVar', $this->raw)){
$this->auxUpdated = false;
unset($this->raw['auxVar']);
}
}
}
-2
View File
@@ -241,8 +241,6 @@ class ResetHelper{
'maxgeneral'=>GameConst::$defaultMaxGeneral,
'maxnation'=>GameConst::$defaultMaxNation,
'conlimit'=>30000,
'gold_rate'=>100,
'rice_rate'=>100,
'develcost'=>$develcost,
'turntime'=>$turntime,
'starttime'=>$starttime,
+4
View File
@@ -80,6 +80,10 @@ class WarUnit{
function getUpdatedValues():array {
return $this->general->getUpdatedValues();
}
function flushUpdateValues():void {
$this->general->flushUpdateValues();
}
protected function clearActivatedSkill(){
foreach($this->activatedSkill as $skillName=>$state){
+1
View File
@@ -154,6 +154,7 @@ class WarUnitCity extends WarUnit{
}
$db->update('city', $updateVals, 'city=%i', $this->raw['city']);
$this->flushUpdateValues();
return $db->affectedRows() > 0;
}