glest / glest-source

Glest is a network multi-player cross-platform 3D real-time strategy (RTS) game, where you create armies of units and battle different factions.
https://glest.io
GNU General Public License v3.0
57 stars 39 forks source link

Fixes problem when choosing the faction of an AI #186

Closed joaomarcoscsilva closed 6 years ago

joaomarcoscsilva commented 6 years ago

This fixes the problem when choosing the faction of an AI in the custom game screen (Issue #184) The problem was happening because the menu_state_custom_game automatically changed the faction selection from Observed to index 0 (Brisith/ Magic), since AI can't be an Observer. To fix that, I created a new class GraphicListBoxFactions that works exactly the same as the normal GraphicListBox, but every time the user press one of the buttons it checks if it currently represents an AI Observer, and then changes the selection accordingly.

andy5995 commented 6 years ago

That was a bug I created when I added the observer patch (which allows observers in slot 5-10 on a 4 player map).

I'm reviewing this now.

Since @mathusummut primarily handles the source code now, I'll want to give him the opportunity to review before merging.

andy5995 commented 6 years ago

Thanks @JoaoMarcosCSilva !