diff options
| author | Giuseppe Gadola <giusgadola@gmail.com> | 2023-02-17 19:37:14 +0100 |
|---|---|---|
| committer | Giuseppe Gadola <giusgadola@gmail.com> | 2023-02-17 19:37:14 +0100 |
| commit | c26e5403159d6d15b1f62a662726634b4eea5861 (patch) | |
| tree | 855a69cddf405b9fdec1713fbc836f27e997b036 /lua/pets/pet.lua | |
| parent | fix: merge pull request #10 from Kyle-Mendes/statefulness (diff) | |
fix: fixed pets not disappearing when killed while paused
Diffstat (limited to 'lua/pets/pet.lua')
| -rw-r--r-- | lua/pets/pet.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lua/pets/pet.lua b/lua/pets/pet.lua index d165b98..f767ed0 100644 --- a/lua/pets/pet.lua +++ b/lua/pets/pet.lua @@ -43,6 +43,10 @@ end -- delete the pet :( function M.Pet:kill() + if self.animation.state.paused then + self.animation:stop() + self.popup:unmount() + end if self.death_animation then self.animation.dying = true else @@ -52,16 +56,12 @@ function M.Pet:kill() end function M.Pet:set_paused(paused) - self.state.paused = paused self.animation:set_state({ paused = paused, }) end function M.Pet:set_hidden(hidden) - self.state.hidden = hidden - self.state.paused = hidden - self.animation:set_state({ hidden = hidden, paused = hidden, |