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")