Commit 076028e6 authored by Gerhard Stein's avatar Gerhard Stein

Mushroom issues fixes

parent abe7c5ab
......@@ -96,6 +96,10 @@ void CMapPlayGalaxy::process(const bool msgboxactive)
for(size_t j=0 ; j<mObjectPtr.size() ; j++)
{
CSpriteObject *theOtherObj = mObjectPtr[j].get();
if( !theOtherObj->exists )
continue;
if( theOtherObj != p_Object )
{
p_Object->isNearby(*theOtherObj);
......
......@@ -7,6 +7,7 @@
#include "CMadMushroom.h"
#include "engine/galaxy/ai/CPlayerLevel.h"
#include "engine/galaxy/ai/CBullet.h"
namespace galaxy
{
......@@ -18,7 +19,6 @@ const int MUSHROOM_HIGH_INERTIA = 150;
CMadMushroom::CMadMushroom(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y) :
CGalaxySpriteObject(pmap, foeID, x, y),
CStunnable(pmap, foeID, x, y),
jumpcounter(0)
{
setupGalaxyObjectOnMap(0x20E4, A_MUSHROOM_BOUNCE);
......@@ -42,10 +42,15 @@ bool CMadMushroom::isNearby(CSpriteObject &theObject)
void CMadMushroom::getTouchedBy(CSpriteObject &theObject)
{
if(theObject.dead)
if(theObject.dead )
return;
CStunnable::getTouchedBy(theObject);
if( CBullet *bullet = dynamic_cast<CBullet*>(&theObject) )
{
bullet->setAction(A_KEENSHOT_IMPACT);
bullet->playSound( SOUND_SHOT_HIT );
bullet->dead = true;
}
if( CPlayerBase *player = dynamic_cast<CPlayerBase*>(&theObject) )
{
......
......@@ -8,12 +8,12 @@
#ifndef CMADMUSHROOM_H_
#define CMADMUSHROOM_H_
#include "engine/galaxy/ai/CStunnable.h"
#include "engine/galaxy/CGalaxySpriteObject.h"
namespace galaxy
{
class CMadMushroom : public CStunnable
class CMadMushroom : public CGalaxySpriteObject
{
public:
CMadMushroom(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment