From 319f1ae65bafed165e2a9a3bb5a7433ba9b0b301 Mon Sep 17 00:00:00 2001 From: Treeki Date: Fri, 25 Jan 2013 23:59:01 +0100 Subject: fixes to the starman handling --- src/koopatlas/core.cpp | 6 ++++-- src/koopatlas/mapmusic.cpp | 2 +- src/koopatlas/player.cpp | 11 ++++++----- 3 files changed, 11 insertions(+), 8 deletions(-) (limited to 'src/koopatlas') diff --git a/src/koopatlas/core.cpp b/src/koopatlas/core.cpp index f130359..c67226e 100644 --- a/src/koopatlas/core.cpp +++ b/src/koopatlas/core.cpp @@ -328,8 +328,6 @@ DoStartLevel(GetGameMgr(), &sl); void dScKoopatlas_c::startMusic() { dKPMusic::play(GetSaveFile()->GetBlock(-1)->currentMapMusic); - if (Player_Flags[0] & 1) - dKPMusic::playStarMusic(); } @@ -519,6 +517,10 @@ void dScKoopatlas_c::executeState_Normal() { pathManager.unlockAllPaths(2); } else if (nowPressed & WPAD_A) { pathManager.unlockAllPaths(0); + SaveBlock *save = GetSaveFile()->GetBlock(-1); + for (int w = 0; w < 6; w++) + for (int l = 0; l < 6; l++) + save->SetLevelCondition(w, l, COND_COIN_ALL); } } diff --git a/src/koopatlas/mapmusic.cpp b/src/koopatlas/mapmusic.cpp index 3c887d4..1bd8a68 100644 --- a/src/koopatlas/mapmusic.cpp +++ b/src/koopatlas/mapmusic.cpp @@ -171,7 +171,7 @@ void dKPMusic::stop() { void dKPMusic::playStarMusic() { - if (!s_starPlaying) + if (s_starPlaying) return; PlaySoundWithFunctionB4(SoundRelatedClass, &s_starHandle, SE_BGM_CS_STAR, 1); diff --git a/src/koopatlas/player.cpp b/src/koopatlas/player.cpp index 6e005b7..00092cd 100644 --- a/src/koopatlas/player.cpp +++ b/src/koopatlas/player.cpp @@ -12,11 +12,6 @@ int daWMPlayer_c::onCreate() { this->modelHandler->setSRT((Vec){0.0,100.0,-100.0}, (S16Vec){0,0,0}, (Vec){2.0,2.0,2.0}); this->modelHandler->draw(); - if (Player_Flags[0] & 1) { - modelHandler->mdlClass->enableStarColours(); - modelHandler->mdlClass->enableStarEffects(); - } - hammerSuit.setup(this->modelHandler); pos = (Vec){0.0f,0.0f,3000.0f}; @@ -42,6 +37,12 @@ int daWMPlayer_c::onDelete() { int daWMPlayer_c::onExecute() { + if (Player_Flags[0] & 1) { + modelHandler->mdlClass->enableStarColours(); + modelHandler->mdlClass->enableStarEffects(); + dKPMusic::playStarMusic(); + } + if (!dScKoopatlas_c::instance->mapIsRunning()) return true; -- cgit v1.2.3