From 3b59105479cef91a00207142a237e188d9aec35b Mon Sep 17 00:00:00 2001 From: Treeki Date: Mon, 25 Feb 2013 21:59:28 +0100 Subject: make WM Player play model animations even when the map is not running --- src/koopatlas/player.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/koopatlas/player.cpp b/src/koopatlas/player.cpp index 3edb202..a087cce 100644 --- a/src/koopatlas/player.cpp +++ b/src/koopatlas/player.cpp @@ -68,10 +68,8 @@ int daWMPlayer_c::onExecute() { dKPMusic::playStarMusic(); } - if (!dScKoopatlas_c::instance->mapIsRunning()) - return true; - - dScKoopatlas_c::instance->pathManager.execute(); + if (dScKoopatlas_c::instance->mapIsRunning()) + dScKoopatlas_c::instance->pathManager.execute(); this->modelHandler->update(); pats[((dPlayerModel_c*)modelHandler->mdlClass)->currentPlayerModelID].process(); @@ -86,21 +84,23 @@ int daWMPlayer_c::onExecute() { // Z is unused for now modelHandler->setMatrix(myMatrix); - if (hasEffect) { - Vec effPos = {pos.x, pos.y, 3300.0f}; - effect.spawn(effectName, 0, &effPos, &rot, &scale); - } + if (dScKoopatlas_c::instance->mapIsRunning()) { + if (hasEffect) { + Vec effPos = {pos.x, pos.y, 3300.0f}; + effect.spawn(effectName, 0, &effPos, &rot, &scale); + } - if (hasSound) { - timer++; + if (hasSound) { + timer++; - if (timer == 12) { - if (step) { MapSoundPlayer(SoundRelatedClass, soundName, 1); step = false; } - else { MapSoundPlayer(SoundRelatedClass, soundName+1, 1); step = true; } - timer = 0; - } + if (timer == 12) { + if (step) { MapSoundPlayer(SoundRelatedClass, soundName, 1); step = false; } + else { MapSoundPlayer(SoundRelatedClass, soundName+1, 1); step = true; } + timer = 0; + } - if (timer > 12) { timer = 0; } + if (timer > 12) { timer = 0; } + } } return true; -- cgit v1.2.3