diff options
Diffstat (limited to 'src/core/clientstate.cc')
-rw-r--r-- | src/core/clientstate.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/core/clientstate.cc b/src/core/clientstate.cc index cc9c79e..503a71f 100644 --- a/src/core/clientstate.cc +++ b/src/core/clientstate.cc @@ -5,6 +5,7 @@ */ #include "core/clientstate.h" +#include "core/application.h" namespace core { @@ -14,6 +15,8 @@ ClientState::ClientState() state_detailvisible = false; state_targetable = false; + state_enginesound = 0; + for (size_t i = 0; i < 3; i++) state_screenlocation[i] = 0; @@ -25,11 +28,24 @@ ClientState::ClientState(Entity *entity) state_visible = false; state_detailvisible = false; state_fuzz = math::randomf(); + + state_enginesound = 0; + assign(entity); } ClientState::~ClientState() -{} +{ + clearsound(); +} + +void ClientState::clearsound() +{ + if (state_enginesound) { + application()->notify_remove_sound(state_enginesound); + state_enginesound = 0; + } +} void ClientState::assign(Entity * entity) { |