HomeWildfire Games

Improvements to gather order when out or resources and fix rP22428

Description

Improvements to gather order when out or resources and fix rP22428

rP22428 introduced an issue, as it expected "this.order.data.initPos" to always exist. But going through GatherNearPosition did not set it.

Fix this by setting that variable in GatherNearPosition.
Use the opportunity to still fallback to the unit's position if the variable were to not exist for some reason (defensive programming against future changes).
Re-enable "return resource" behaviour as the final fallback case - The GatherNearPosition call previously always passed thus this no longer triggered.

Possible follow-up: try gathering near the dropsite found.

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

Details