lampe-games / godot-open-rts

Open Source RTS game made in Godot 4
https://lampe-games.itch.io/open-rts
MIT License
494 stars 70 forks source link

Selection of starting units doesn't work #94

Closed berndrakell closed 6 months ago

berndrakell commented 6 months ago

When I run the game and select one of my starting units they appear to be selected but the unit menu doesn't open and they are not moveable.

grafik

berndrakell commented 6 months ago

The problem for this lays in Match.gd function

func _setup_and_spawn_unit()

where _setup_unit_groups(unit) is called before player.add_child(unit). In _setup_unit_groups(unit) the player of the unit must be evaluated to assign it to the correct group. As the unit node does not have a parent yet, the player is returned as null and the unit is not identified as belonging to the human player

Scony commented 6 months ago

Right, this is a regression introduced in recent refactoring - it was tested using the manual test with predefined units only... Thanks for reporting!