瀏覽代碼

:wrench: Change state as soon as possible

Do not solve :
E 0:00:18:0303   balle_electrique.gd:26 @ electrise(): Function blocked during in/out signal. Use set_deferred("monitoring", true/false).
  <C++ Error>    Condition "locked" is true.
  <C++ Source>   scene/2d/area_2d.cpp:399 @ set_monitoring()
  <Stack Trace>  balle_electrique.gd:26 @ electrise()
                 balle_electrique.gd:74 @ _quand_champ_electrique_detecte_coprs()
DricomDragon 8 月之前
父節點
當前提交
7e2d1b1264
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      godot/composants/objets/balle/balle_elec/balle_electrique.gd

+ 2 - 2
godot/composants/objets/balle/balle_elec/balle_electrique.gd

@@ -22,13 +22,13 @@ func _process(delta: float) -> void:
 func electrise(brique: Brique) -> void:
 	assert(surchargee, "Ne peut pas electriser si non chargee")
 	brique.frapper(1)
-	decharge.emit()
 	surchargee = false
+	decharge.emit()
 
 
 func recharge() -> void:
-	charge.emit()
 	surchargee = true
+	charge.emit()
 
 
 ## La balle electrique se recharge au contact de la raquette