Updated autofish to respawn when killed

This commit is contained in:
Computeiful
2020-01-28 02:43:59 +00:00
parent 06b7779db5
commit c251b48043

View File

@ -33,6 +33,7 @@ func main() {
c.Events.ChatMsg = onChatMsg c.Events.ChatMsg = onChatMsg
c.Events.Disconnect = onDisconnect c.Events.Disconnect = onDisconnect
c.Events.SoundPlay = onSound c.Events.SoundPlay = onSound
c.Events.Die = onDeath
//JoinGame //JoinGame
err = c.HandleGame() 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 { func onGameStart() error {
log.Println("Game start") log.Println("Game start")