diff options
author | Treeki <treeki@gmail.com> | 2013-05-07 23:48:57 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2013-05-07 23:48:57 +0200 |
commit | e7e26a11ec03629acc7d351bfa6d6d5b618771b4 (patch) | |
tree | 6149009218edf0fa9df03eda95459a614095715c /src | |
parent | 377ad7df2409e1f3fb522937ee08a5351c36c4bc (diff) | |
download | kamek-e7e26a11ec03629acc7d351bfa6d6d5b618771b4.tar.gz kamek-e7e26a11ec03629acc7d351bfa6d6d5b618771b4.zip |
shyguy balloon popping actors restricted
Diffstat (limited to '')
-rw-r--r-- | src/shyguy.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/shyguy.cpp b/src/shyguy.cpp index 27c0d70..192ac7d 100644 --- a/src/shyguy.cpp +++ b/src/shyguy.cpp @@ -178,13 +178,20 @@ daShyGuy *daShyGuy::build() { // Collision Functions //////////////////////// +bool actorCanPopBalloon(dStageActor_c *ac) { + int n = ac->name; + return n == PLAYER || n == YOSHI || + n == PL_FIREBALL || n == ICEBALL || + n == YOSHI_FIRE || n == HAMMER; +} // Collision callback to help shy guy not die at inappropriate times and ruin the dinner void shyCollisionCallback(ActivePhysics *apThis, ActivePhysics *apOther) { int t = ((daShyGuy*)apThis->owner)->type; if (t == 6 || t == 7 || t == 8) { // Should I do something about ice blocks here? - ((daShyGuy*)apThis->owner)->popBalloon(); + if (actorCanPopBalloon(apOther->owner)) + ((daShyGuy*)apThis->owner)->popBalloon(); } if ((apOther->owner->name == 89) && (t == 5)) { return; } @@ -199,7 +206,8 @@ daShyGuy *daShyGuy::build() { void balloonSmack(ActivePhysics *apThis, ActivePhysics *apOther) { if (((daShyGuy*)apThis->owner)->frzMgr._mstate == 0) { - ((daShyGuy*)apThis->owner)->popBalloon(); + if (actorCanPopBalloon(apOther->owner)) + ((daShyGuy*)apThis->owner)->popBalloon(); } } |