FIxed hitting a banana when having a bomb
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7801 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
94015c38cd
commit
5fcccd6f32
@ -111,10 +111,13 @@ void Attachment::hitBanana(Item *item, int new_attachment)
|
|||||||
{
|
{
|
||||||
float leftover_time = 0.0f;
|
float leftover_time = 0.0f;
|
||||||
|
|
||||||
|
bool add_a_new_item = true;
|
||||||
|
|
||||||
switch(getType()) // If there already is an attachment, make it worse :)
|
switch(getType()) // If there already is an attachment, make it worse :)
|
||||||
{
|
{
|
||||||
case ATTACH_BOMB:
|
case ATTACH_BOMB:
|
||||||
{
|
{
|
||||||
|
add_a_new_item = false;
|
||||||
projectile_manager->newExplosion(m_kart->getXYZ());
|
projectile_manager->newExplosion(m_kart->getXYZ());
|
||||||
m_kart->handleExplosion(m_kart->getXYZ(), /*direct_hit*/ true);
|
m_kart->handleExplosion(m_kart->getXYZ(), /*direct_hit*/ true);
|
||||||
clear();
|
clear();
|
||||||
@ -136,7 +139,7 @@ void Attachment::hitBanana(Item *item, int new_attachment)
|
|||||||
leftover_time = m_time_left;
|
leftover_time = m_time_left;
|
||||||
break;
|
break;
|
||||||
case ATTACH_PARACHUTE:
|
case ATTACH_PARACHUTE:
|
||||||
new_attachment = 2; // anvil
|
new_attachment = 2;
|
||||||
leftover_time = m_time_left;
|
leftover_time = m_time_left;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -157,6 +160,8 @@ void Attachment::hitBanana(Item *item, int new_attachment)
|
|||||||
new_attachment);
|
new_attachment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (add_a_new_item)
|
||||||
|
{
|
||||||
switch (new_attachment)
|
switch (new_attachment)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
@ -181,6 +186,7 @@ void Attachment::hitBanana(Item *item, int new_attachment)
|
|||||||
m_kart->updatedWeight();
|
m_kart->updatedWeight();
|
||||||
break ;
|
break ;
|
||||||
} // switch
|
} // switch
|
||||||
|
}
|
||||||
} // hitBanana
|
} // hitBanana
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user