Fix postpone error
This commit is contained in:
		| @@ -32,6 +32,10 @@ export class SendResourcesAction extends ActionController { | |||||||
|         console.log('To transfer res', readyToTransfer); |         console.log('To transfer res', readyToTransfer); | ||||||
|         console.log('Remaining res', remainingResources); |         console.log('Remaining res', remainingResources); | ||||||
|  |  | ||||||
|  |         if (!remainingResources.empty() && readyToTransfer.amount() < 100) { | ||||||
|  |             throw new TryLaterError(aroundMinutes(10), 'Not minimal amount'); | ||||||
|  |         } | ||||||
|  |  | ||||||
|         if (!remainingResources.empty()) { |         if (!remainingResources.empty()) { | ||||||
|             console.log('Schedule next', remainingResources); |             console.log('Schedule next', remainingResources); | ||||||
|             this.scheduler.scheduleTask( |             this.scheduler.scheduleTask( | ||||||
|   | |||||||
| @@ -88,8 +88,8 @@ export class Scheduler { | |||||||
|  |  | ||||||
|         const villageId = task.args.villageId; |         const villageId = task.args.villageId; | ||||||
|         const modifyTime = t => withTime(t, timestamp() + seconds); |         const modifyTime = t => withTime(t, timestamp() + seconds); | ||||||
|         const buildPred = t => sameVillage(villageId, t.args) && isBuildingTask(task.name); |         const buildPred = t => sameVillage(villageId, t.args) && isBuildingTask(t.name); | ||||||
|         const trainPred = t => sameVillage(villageId, t.args) && isTrainTroopTask(task.name); |         const trainPred = t => sameVillage(villageId, t.args) && isTrainTroopTask(t.name); | ||||||
|  |  | ||||||
|         if (isBuildingTask(task.name) && villageId) { |         if (isBuildingTask(task.name) && villageId) { | ||||||
|             this.taskQueue.modify(buildPred, modifyTime); |             this.taskQueue.modify(buildPred, modifyTime); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user