beyond-all-reason / Beyond-All-Reason

Main game repository for Beyond All Reason.
https://www.beyondallreason.info/
Other
1.75k stars 291 forks source link

cus_gl4: check unit validity before asking about the unit #3552

Closed sprunk closed 2 months ago

sprunk commented 2 months ago

No use checking validity after already having passed potentially invalid data to a function that could blow up on invalid data.

AFAIK the current implementation of Spring.GetUnitIsCloaked shouldn't blow up but maybe it's good to avoid spreading bad patterns regardless.