beyond-all-reason / spring

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

Put special team/etc IDs together #1532

Open sprunk opened 3 weeks ago

sprunk commented 3 weeks ago

Right now special player ID constants are spread all over the codebase. https://github.com/beyond-all-reason/spring/blob/747f18b2222860ae264853aa062c5b3d9b164e25/rts/Sim/Misc/GlobalConstants.h#L71 https://github.com/beyond-all-reason/spring/blob/747f18b2222860ae264853aa062c5b3d9b164e25/rts/Game/ChatMessage.h#L23-L25 https://github.com/beyond-all-reason/spring/blob/747f18b2222860ae264853aa062c5b3d9b164e25/rts/Net/GameServer.h#L28

This is confusing (see e.g. #1501). Put them all together.

This also applies to other things with an ID. In particular MAX_AIS has dual use as a special ID and as the limit for non-special IDs, split it into two and keep them adjacent to each other.

harsha-mangena commented 3 weeks ago

Hey @sprunk, Can I pick this issue?

sprunk commented 3 weeks ago

sure

harsha-mangena commented 3 weeks ago

@sprunk, Should I create an appropriate file for new IDs or keep them in the GlobalConstants.h ?

sprunk commented 3 weeks ago

IMO better to keep them in GlobalConstants.h because they are global constants

harsha-mangena commented 3 weeks ago

Got it. Thank You.