HomeWildfire Games

Partial revert of rP24956 / REJECT_ORDER with FinishOrder()

Description

Partial revert of rP24956 / REJECT_ORDER with FinishOrder()

Fixes rP24956, by partially reverting it.

If the new order is rejected, PushOrder() will call FinishOrder. If there are no more orders on the queue, this calls SetNextState("idle"), with the intention os switching the unit to IDLE. However, this only works from within an FSM call, and thus does nothing if a new command gets rejected.

The problem is that this.order/this.orderQueue is already replaced by the point the order is rejected when called via ReplaceOrder. Ideally, this would not happen (but doing so isn't trivial).

The current code avoids having 2 different ways to reject an order, thus isn't a complete revert of rP24956. It triggers an IDLE re-entry that wasn't there before if the unit is IDLE when it receives the rejected order, which at the moment basically never happens.

Refs #5771 (reopened)

Reported by: gameboy

Comments by: Freagarach, Angen

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