Added the KILL YOURSELF button for testing the Godot crashes

remotes/1705725415861086127/tmp_refs/heads/main
unfa 2021-09-19 22:33:17 +02:00
parent 00ecd1f810
commit 17527f7c8d
2 changed files with 15 additions and 2 deletions

View File

@ -219,8 +219,9 @@ func push_local_player_info(): #
#assert(player_node != null, "Attempting to delete a player node that does not exist")
player_node.name = str(player_node.name) + "_dead" # avoids name collision when instancing another player scene
player_node.queue_free()
print("before free")
player_node.free()
print("after free")
spawn_queue[pid] = uptime + respawn_delay
func create_player(pid: int, is_local:= false, respawn:= false) -> void:
@ -350,3 +351,7 @@ func _on_ColorPickerButton_color_changed(color):
func _on_CheckButton_toggled(button_pressed):
AudioServer.set_bus_mute(0, button_pressed)
func _on_Button_pressed():
destroy_player(get_tree().multiplayer.get_unique_id())

View File

@ -103,6 +103,13 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="Button" type="Button" parent="NetworkTesting"]
offset_top = 180.0
offset_right = 188.0
offset_bottom = 209.0
text = "KILL YOURSELF"
script = null
[node name="Label" type="Label" parent="."]
offset_right = 505.0
offset_bottom = 238.0
@ -122,5 +129,6 @@ script = null
[connection signal="pressed" from="NetworkTesting/Connect" to="." method="_on_Connect_pressed"]
[connection signal="text_submitted" from="NetworkTesting/TextEdit" to="." method="_on_TextEdit_text_submitted"]
[connection signal="color_changed" from="NetworkTesting/ColorPickerButton" to="." method="_on_ColorPickerButton_color_changed"]
[connection signal="pressed" from="NetworkTesting/Button" to="." method="_on_Button_pressed"]
[editable path="HUD"]