beyond-all-reason / spring

A powerful free cross-platform RTS game engine
https://beyond-all-reason.github.io/spring/
Other
210 stars 99 forks source link

CanAttack unitdef tag is ambiguous and needs alteration so that it does not interfere with other firing tags #1499

Open ForbodingAngel opened 4 months ago

ForbodingAngel commented 4 months ago

The "CanAttack" unitdef tag poses ambiguity and requires modification to avoid conflicting with other firing-related tags. Among the available tags, "CanAttack = true," "noAutoFire = true," and "canManualFire = true," should serve distinct purposes.

Disabling the "Attack" button entails setting "canAttack" to false, which is beneficial when you wish to restrict the unit from receiving attack orders, however, doing so disables the use of manual-fire weapons.

The "canManualFire" tag holds significance as it ensures that firing removes the order, preventing repetitive attacks on the same target and allowing for seamless integration with order management systems.

Similarly, "noAutoFire" is crucial to prevent automatic firing, especially for units equipped with manual-fire weapons.

The challenge arises from the fact that substituting "canAttack" for "canManualFire" is inadequate, as it inadvertently disables manual firing entirely, rendering it impossible to eliminate the basic attack functionality without completely deactivating manual fire.