summaryrefslogtreecommitdiff
path: root/src/shyguy.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2013-05-07 23:48:57 +0200
committerTreeki <treeki@gmail.com>2013-05-07 23:48:57 +0200
commite7e26a11ec03629acc7d351bfa6d6d5b618771b4 (patch)
tree6149009218edf0fa9df03eda95459a614095715c /src/shyguy.cpp
parent377ad7df2409e1f3fb522937ee08a5351c36c4bc (diff)
downloadkamek-e7e26a11ec03629acc7d351bfa6d6d5b618771b4.tar.gz
kamek-e7e26a11ec03629acc7d351bfa6d6d5b618771b4.zip
shyguy balloon popping actors restricted
Diffstat (limited to 'src/shyguy.cpp')
-rw-r--r--src/shyguy.cpp12
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();
}
}