diff --git a/webapp/controller/HeroController.class.php b/webapp/controller/HeroController.class.php index f794dd6a..f78cd32a 100644 --- a/webapp/controller/HeroController.class.php +++ b/webapp/controller/HeroController.class.php @@ -393,6 +393,10 @@ class HeroController extends BaseAuthedController { $this->_rspErr(1, 'cost hero parameter error'); return; } + if ($costHeroDb['lock_type']) { + $this->_rspErr(2, 'Cannot operate during locking'); + return; + } { $srcHeroDb = Hero::find($this->_getV(TN_HERO_QUALITY_UP, $slotId)); if ($srcHeroDb) { @@ -428,7 +432,7 @@ class HeroController extends BaseAuthedController { $this->_rspErr(3, 'Trial hero cannot operate'); return; } - if ($heroDb['unlock_time'] > $this->_getNowTime()) { + if ($heroDb['lock_type']) { $this->_rspErr(2, 'Cannot operate during locking'); return; } @@ -497,7 +501,14 @@ class HeroController extends BaseAuthedController { 'unlock_time' => $this->_getNowTime() + $nextQualityMeta['time'], ) ); + Hero::update($costHeroUniId, + array( + 'lock_type' => Hero::COST_LOCK, + 'unlock_time' => $this->_getNowTime() + $nextQualityMeta['time'], + ) + ); $this->_setV(TN_HERO_QUALITY_UP, (int)$slotId, (int)$heroDb['idx']); + $this->_setV(TN_HERO_QUALITY_UP, (int)$slotId * 100, (int)$costHeroDb['idx']); $propertyChgService = new services\PropertyChgService(); $propertyChgService->addHeroChg(); $propertyChgService->addBagChg();