Skip to content

Commit

Permalink
Prevent actions on certain units from being removed
Browse files Browse the repository at this point in the history
  • Loading branch information
Scony committed Aug 10, 2023
1 parent 8a6ef7d commit 92b3914
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 1 deletion.
2 changes: 2 additions & 0 deletions source/match/hud/ProductionQueue.gd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ func _ready():


func _reset():
if not is_inside_tree():
return
_remove_queue_elements()
_clear_observed_production_manager()
if _try_observing_production_manager():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func provision(resources, metadata):
_number_of_pending_worker_resource_requests -= 1
if _ccs.is_empty():
return
_ccs[0].action.produce(WorkerScene) # TODO: investigate how come CC has no action
_ccs[0].action.produce(WorkerScene)
_number_of_pending_workers += 1
elif metadata == "cc":
assert(
Expand Down
7 changes: 7 additions & 0 deletions source/match/units/AircraftFactory.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@ func _ready():
if not is_constructed():
await constructed
action = ManagingProduction.new()


func _set_action(action_node):
if not _action_locked and action == null:
super(action_node)
elif action_node != null:
action_node.queue_free()
7 changes: 7 additions & 0 deletions source/match/units/AntiAirTurret.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@ func _ready():
if not is_constructed():
await constructed
action = WaitingForTargets.new()


func _set_action(action_node):
if not _action_locked and action == null:
super(action_node)
elif action_node != null:
action_node.queue_free()
7 changes: 7 additions & 0 deletions source/match/units/AntiGroundTurret.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@ func _ready():
if not is_constructed():
await constructed
action = WaitingForTargets.new()


func _set_action(action_node):
if not _action_locked and action == null:
super(action_node)
elif action_node != null:
action_node.queue_free()
7 changes: 7 additions & 0 deletions source/match/units/CommandCenter.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@ func _ready():
if not is_constructed():
await constructed
action = ManagingProduction.new()


func _set_action(action_node):
if not _action_locked and action == null:
super(action_node)
elif action_node != null:
action_node.queue_free()
7 changes: 7 additions & 0 deletions source/match/units/VehicleFactory.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@ func _ready():
if not is_constructed():
await constructed
action = ManagingProduction.new()


func _set_action(action_node):
if not _action_locked and action == null:
super(action_node)
elif action_node != null:
action_node.queue_free()

0 comments on commit 92b3914

Please sign in to comment.