Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Freeciv commit message: Fix all can_unit_do_activity_targeted_at() calls. A call to is_action_enabled_unit_on_*() replaced the hard coded checks in can_unit_do_activity_targeted_at() for each activity that became action enabler controlled. is_action_enabled_unit_on_*() cares about distance between actor an target. This caused can_unit_do_activity_targeted_at() to lose it's ability to speculate about the actor unit's tile for action enabler controlled activities. Actor unit tile speculation with can_unit_do_activity_targeted_at() is only used in the auto settler code of ai/tex, ai/threaded and advisors/autosettlers. Its remaining users can't be ported to use speculative action enabler evaluation until all the activities they may consider have corresponding actions. Introduce auto_settlers_speculate_can_act_at(). It calls the correct speculative evaluation function based on if the specified activity has a corresponding action or not: can_unit_do_activity_targeted_at() when no corresponding action is found. action_speculate_unit_on_*() when it is. Port remaining actor position speculating can_unit_do_activity_targeted_at() calls to auto_settlers_speculate_can_act_at(). Assert that calls to can_unit_do_activity_targeted_at() for action enabler controlled activities don't speculate about actor unit position. See hrm Bug #758450
- Loading branch information