Project

General

Profile

Bug #661869

ACTIVITY_GOTO not set permanently for military units approaching target

Added by Marko Lindqvist 6 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Normal
Category:
AI
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

adv_follow_path() always sets ACTIVITY_IDLE to the unit in the end. This breaks number of places where the code tries to guess if a unit is approaching certain place by checking if it's activity is ACTIVITY_GOTO and goto_tile appropriate. One such broken place is find_something_to_kill() trying to estimate how many units are about to help in conquest of a city.

KeepActivityGoto.patch (1.74 KB) KeepActivityGoto.patch Marko Lindqvist, 2017-05-18 10:39 PM

History

#1 Updated by Marko Lindqvist 6 months ago

  • Subject changed from adv_follow_path() clears existing goto state to ACTIVITY_GOTO not set permanently for military units approaching target

Actually adv_follow_path() is doing what it's documented to do - it does restore values like they were before the call. The problem lies in that the calling code does not set ACTIVITY_GOTO itself but it's set only for the duration of the adv_follow_path().

#3 Updated by Marko Lindqvist 6 months ago

  • Status changed from In Progress to Resolved

#4 Updated by Marko Lindqvist 6 months ago

  • Status changed from Resolved to Closed
  • Assignee set to Marko Lindqvist

Also available in: Atom PDF