Opened 12 years ago

Closed 12 years ago

Last modified 5 years ago

#1395 closed defect (fixed)

Idle worker selection broken

Reported by: Erik Johansson Owned by: Jonathan Waller
Priority: Must Have Milestone: Alpha 10
Component: Core engine Keywords:
Cc: Patch:

Description

Or perhaps it's rather the "marking villagers as idle" part that's broken. Either way, I do have units standing idle (the case where I noticed it was with female citizens having gathered all the food from a farm) but not either moving to a similar resource (there was another farm nearby, I think it would be within the radius, but I could be wrong) or be "marked as idle". After I had ordered the unit to move a short distance and it had stopped moving it was possible to select it via the idle worker function.

Change History (6)

comment:1 by Kieran P, 12 years ago

Milestone: BacklogAlpha 10
Priority: Should HaveMust Have

comment:2 by Jonathan Waller, 12 years ago

Owner: set to Jonathan Waller
Resolution: fixed
Status: newclosed

In 11806:

Check that a nearby resource has >0 resources left. Fixes #1395.
Also added a check to TechnologyManager to see if player is defined.

comment:3 by Jonathan Waller, 12 years ago

Resolution: fixed
Status: closedreopened

The error still occurs in some cases. Leper gave a test case of gathering from the berry bushes on Massacre of Delphi.

comment:4 by Jonathan Waller, 12 years ago

Resolution: fixed
Status: reopenedclosed

In 11824:

Add SetNextStateAlwaysEnter() function to reload a state when switching to it from itself. Fixes #1395.

comment:5 by elexis, 5 years ago

In r22023 by wraitii:

Always leave/reenter the top-most FSM state when SetNextState is called with the current FSM state.

When SetNextState is called with the current state, it will leave and re-enter so that any relevant cleanup will get called and things work as expected. It will prevent possibly awkward code issues in UnitAI, which already called SetNextStateAlwaysEntering in a number of places to work around them.

This should most likely have been the default behaviour in the first place.

Reviewed By: Itms

Differential Revision: https://code.wildfiregames.com/D1488

comment:6 by fatherbushido, 5 years ago

I felt here too.

Note: See TracTickets for help on using tickets.