| 800 | } |
| 801 | |
| 802 | void Player::notifyWorkerStopsAction(Creature& worker, CreatureActionType actionType) |
| 803 | { |
| 804 | uint32_t index = static_cast<uint32_t>(actionType); |
| 805 | if(index >= mWorkersActions.size()) |
| 806 | { |
| 807 | OD_LOG_ERR("Invalid index seatId=" + Helper::toString(getId()) + ", value=" + Helper::toString(index) + ", size=" + Helper::toString(mWorkersActions.size())); |
| 808 | return; |
| 809 | } |
| 810 | |
| 811 | // Sanity check |
| 812 | if(mWorkersActions[index] <= 0) |
| 813 | { |
| 814 | OD_LOG_ERR("No worker doing action seatId=" + Helper::toString(getId()) + ", action=" + CreatureAction::toString(actionType)); |
| 815 | return; |
| 816 | } |
| 817 | |
| 818 | |
| 819 | mWorkersActions[index]--; |
| 820 | } |
| 821 | |
| 822 | uint32_t Player::getNbWorkersDoing(CreatureActionType actionType) const |
| 823 | { |
no test coverage detected