Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool Building::startProduction(Account *account, const uint32_t &start_time, Human *worker) {
- if (!account)
- return false;
- EventAction &event = setParams().setEvent();
- event.setType(EventAction::PRODUCTION_COMPLETE);
- event.setStart(start_time);
- event.setFinish(start_time + getProcessTime(account, start_time));
- if (!Dicts::quests().updateEvent(account, event.getType()))
- return false;
- if (!changeState(account, PRODUCTING))
- return false;
- if (worker)
- setWorker(worker);
- // Если это Exploration объект - выставляем lock_after
- if (const Interactive *interactive = Dicts::getInteractive(*this)) {
- Aspects::Exploration exploration_aspect;
- if (interactive->findAspect(exploration_aspect)) {
- auto iteration = exploration_aspect.findIteration(getParams().getExploreStage());
- if (iteration && iteration->isNeedLock())
- setFlags().setLockAfter(true);
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement