From c251b48043d02c6a14fc388007b63b8d71f48ba6 Mon Sep 17 00:00:00 2001 From: Computeiful <> Date: Tue, 28 Jan 2020 02:43:59 +0000 Subject: [PATCH] Updated autofish to respawn when killed --- cmd/autofish/autofish.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/autofish/autofish.go b/cmd/autofish/autofish.go index 06756b5..bb9bde5 100644 --- a/cmd/autofish/autofish.go +++ b/cmd/autofish/autofish.go @@ -33,6 +33,7 @@ func main() { c.Events.ChatMsg = onChatMsg c.Events.Disconnect = onDisconnect c.Events.SoundPlay = onSound + c.Events.Die = onDeath //JoinGame err = c.HandleGame() @@ -41,6 +42,12 @@ func main() { } } +func onDeath() error { + log.Println("Died and Respawned") + c.Respawn() // If we exclude Respawn(...) then the player won't press the "Respawn" button upon death + return nil +} + func onGameStart() error { log.Println("Game start")