From e7e26a11ec03629acc7d351bfa6d6d5b618771b4 Mon Sep 17 00:00:00 2001 From: Treeki Date: Tue, 7 May 2013 23:48:57 +0200 Subject: shyguy balloon popping actors restricted --- src/shyguy.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') 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(); } } -- cgit v1.2.3