Commit b9556167 authored by Gerhard Stein's avatar Gerhard Stein

more cleanups

parent d502077a
......@@ -152,7 +152,6 @@ struct EventSendSelectionDialogMsg : CEvent {
}
};
/**
* \description This event will spawn a new object
*
......
......@@ -142,7 +142,8 @@ void CPlayerBase::getAnotherLife(const int lc_x, const int lc_y, const bool disp
{
m_Inventory.Item.m_lifes++;
g_pSound->playSound( SOUND_EXTRA_LIFE );
m_ObjectPtrs.push_back(new CItemEffect(mp_Map, 0, lc_x<<CSF, lc_y<<CSF, got_sprite_item_pics[10]));
if(display)
m_ObjectPtrs.push_back(new CItemEffect(mp_Map, 0, lc_x<<CSF, lc_y<<CSF, got_sprite_item_pics[10]));
}
......@@ -267,7 +268,7 @@ void CPlayerBase::processLevelMiscFlagsCheck()
if(m_Item.m_drops >= 100)
{
m_Item.m_drops = 0;
getAnotherLife(lc_x, lc_y, false);
getAnotherLife(lc_x, lc_y, true);
}
g_pSound->playSound( SOUND_GET_DROP );
......
......@@ -15,7 +15,8 @@ const int LINDSEY_MOVE_TIME = 60;
CLindsey::CLindsey(CMap *pmap, const Uint16 foeID, Uint32 x, Uint32 y) :
CGalaxySpriteObject(pmap, foeID, x, y),
m_timer(0)
m_timer(0),
prepareToVanish(false)
{
setupGalaxyObjectOnMap(0x38EA, 0);
......@@ -30,22 +31,25 @@ m_timer(0)
void CLindsey::process()
{
if(m_timer <= 0)
{
m_timer = LINDSEY_MOVE_SPEED;
yDirection = (yDirection==UP) ? DOWN : UP;
}
if(yDirection == UP)
moveUp(LINDSEY_MOVE_SPEED);
else
moveDown(LINDSEY_MOVE_SPEED);
m_timer--;
if(!processActionRoutine())
exists = false;
if(prepareToVanish)
exists = false;
if(m_timer <= 0)
{
m_timer = LINDSEY_MOVE_SPEED;
yDirection = (yDirection==UP) ? DOWN : UP;
}
if(yDirection == UP)
moveUp(LINDSEY_MOVE_SPEED);
else
moveDown(LINDSEY_MOVE_SPEED);
m_timer--;
if(!processActionRoutine())
exists = false;
}
void CLindsey::getTouchedBy(CSpriteObject &theObject)
......@@ -82,9 +86,8 @@ void CLindsey::getTouchedBy(CSpriteObject &theObject)
msgs.push_back( new EventSendBitmapDialogMsg(*g_pGfxEngine->getBitmap("KEENTHUMBSUP"), lindsey_text[2], RIGHT) );
EventContainer.add( new EventSendBitmapDialogMessages(msgs) );
exists = false;
prepareToVanish = true;
}
}
......
......@@ -25,6 +25,7 @@ public:
private:
int m_timer;
std::map<int, std::string> answermap;
bool prepareToVanish;
};
} /* namespace galaxy */
......
......@@ -22,11 +22,11 @@ const int SLIDER_WIDTH = 16;
CGUINumberControl::CGUINumberControl( const std::string& text,
const int startValue,
const int endValue,
const int deltaValue,
const int value,
const bool slider ) :
const int startValue,
const int endValue,
const int deltaValue,
const int value,
const bool slider ) :
mText(text),
mStartValue(startValue),
mEndValue(endValue),
......
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