fix
parent
378eadb7c1
commit
2348065005
|
@ -192,12 +192,15 @@ public class MapManager extends MongoBase {
|
|||
int recoveryTime = SGameSetting.getGameSetting().getRecoveryTime();
|
||||
int heroTimes = SGameSetting.getGameSetting().getHeroTimes();
|
||||
int recoveryTimes = (updateTime - lastUpdateEnergyTime)/recoveryTime;
|
||||
if(itemNum<heroTimes && recoveryTimes>0){
|
||||
int addValue = MathUtils.setBetweenWithMax(itemNum+recoveryTimes,0,heroTimes);
|
||||
if(addValue!=0){
|
||||
item.setItemNum(addValue);
|
||||
setLastUpdateEnergyTime(item, updateTime, lastUpdateEnergyTime);
|
||||
if( recoveryTimes>0){
|
||||
if(itemNum<heroTimes ){
|
||||
int addValue = MathUtils.setBetweenWithMax(itemNum+recoveryTimes,0,heroTimes);
|
||||
if(addValue!=0){
|
||||
item.setItemNum(addValue);
|
||||
}
|
||||
}
|
||||
int time = lastUpdateEnergyTime + recoveryTimes*recoveryTime;
|
||||
item.setEndingTime(time);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue