HomeWildfire Games

Properly discard orders.

Description

Properly discard orders.

Instead of manually calling FinishOrder(). Also, { "discardOrder": true } is changed to a const false.

Differential revision: D3283
Fixes: #5771
Comments by: @Angen, @Stan, @wraitii

Event Timeline

wraitii raised a concern with this commit.Mar 1 2021, 4:22 PM
wraitii added a subscriber: gameboy.

Causes the @gameboy bug. The problem is subtle and annoying.

Before, when FinishOrder() was called inside an "Order.X" message to reject an order, we were still processing the FSM state. So FinishOrder's SetNextState() would actually do something. Now it does nothing -> units don't go in IDLE when out of orders.

This commit now has outstanding concerns.Mar 1 2021, 4:22 PM

I actually think it's cleaner to call FinishOrder() from inside the FSM than handle it from outside. So I'd favour replacing the return REJECT_ORDER with a return rejectOrder() function that does that.

wraitii resigned from this commit.Mar 16 2021, 9:18 AM
This commit no longer requires audit.Mar 16 2021, 9:18 AM