From f4526064654ad2ed884e63eb633babda523d73cd Mon Sep 17 00:00:00 2001 From: Colin Noga Date: Sun, 2 Jun 2013 10:54:54 -0500 Subject: challenge star --- src/challengeStar.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/challengeStar.cpp b/src/challengeStar.cpp index ec80661..f754188 100644 --- a/src/challengeStar.cpp +++ b/src/challengeStar.cpp @@ -22,6 +22,7 @@ class dChallengeStar : public dEn_c { u64 eventFlag; s32 timer; + bool collected; static dChallengeStar *build(); @@ -39,6 +40,12 @@ class dChallengeStar : public dEn_c { void dChallengeStar::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) { + + if (collected) { + this->Delete(1); + return; } + + PlaySoundAsync(this, SE_OBJ_BROOM_KEY_SHOW); SpawnEffect("Wm_ob_greencoinkira_a", 0, &this->pos, &(S16Vec){0,0,0}, &(Vec){0.8, 0.8, 0.8}); @@ -46,6 +53,8 @@ void dChallengeStar::playerCollision(ActivePhysics *apThis, ActivePhysics *apOth if (GlobalStarsCollected == 0) { dFlagMgr_c::instance->flags |= this->eventFlag; } + + collected = true; this->Delete(1); } @@ -81,6 +90,7 @@ dChallengeStar *dChallengeStar::build() { int dChallengeStar::onCreate() { + collected = false; char die = this->settings & 0xF; if (GetSpecificPlayerActor(die) == 0) { this->Delete(1); return 2; } -- cgit v1.2.3