버그 수정
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -681,6 +681,7 @@ class General implements iAction{
|
||||
$this->rankVarSet = [];
|
||||
|
||||
$this->getLogger()->flush();
|
||||
$this->flushUpdateValues();
|
||||
return $db->affectedRows() > 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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']);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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,
|
||||
|
||||
@@ -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){
|
||||
|
||||
@@ -154,6 +154,7 @@ class WarUnitCity extends WarUnit{
|
||||
}
|
||||
|
||||
$db->update('city', $updateVals, 'city=%i', $this->raw['city']);
|
||||
$this->flushUpdateValues();
|
||||
return $db->affectedRows() > 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user