summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/challengeStar.cpp10
1 files changed, 10 insertions, 0 deletions
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; }