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

(Potential) Race Condition on CommandCenterMenu #66

Closed domenukk closed 11 months ago

domenukk commented 11 months ago

When trying to produce a worker at the moment the CommandCenter gets destroyed, the game stops at:

func _on_produce_worker_button_pressed():
>   if unit.action != null and unit.action is ManagingProductionAction:
        unit.action.produce(WorkerUnit)

with Invalid get Index 'action' (on base: 'previously freed'). And an error log:

E 0:01:27:0191   step: Error calling method from CallbackTweener: 'hide': Instance is null
  <C++ Error>    Method/function failed. Returning: false
  <C++ Source>   scene/animation/tween.cpp:679 @ step()