Removed Kart::attach(), Kart::getAttachment()->set

can be used instead.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9899 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2011-09-27 01:13:42 +00:00
parent 2e571a1172
commit d3276d0adf
3 changed files with 15 additions and 13 deletions

View File

@ -255,8 +255,9 @@ void Powerup::use()
break ;
case PowerupManager::POWERUP_SWATTER:
m_owner->getAttachment()->set(Attachment::ATTACH_SWATTER,
m_owner->getKartProperties()->getSwatterDuration());
m_owner->getAttachment()
->set(Attachment::ATTACH_SWATTER,
m_owner->getKartProperties()->getSwatterDuration());
break;
case PowerupManager::POWERUP_BUBBLEGUM:
{
@ -312,8 +313,8 @@ void Powerup::use()
if(kart == m_owner) continue;
if(kart->getPosition() == 1)
{
kart->attach(Attachment::ATTACH_ANVIL,
stk_config->m_anvil_time);
kart->getAttachment()->set(Attachment::ATTACH_ANVIL,
stk_config->m_anvil_time);
kart->updatedWeight();
kart->adjustSpeed(stk_config->m_anvil_speed_factor*0.5f);
@ -350,8 +351,9 @@ void Powerup::use()
if(kart->isEliminated() || kart== m_owner) continue;
if(m_owner->getPosition() > kart->getPosition())
{
kart->attach(Attachment::ATTACH_PARACHUTE,
stk_config->m_parachute_time_other);
kart->getAttachment()
->set(Attachment::ATTACH_PARACHUTE,
stk_config->m_parachute_time_other);
if(kart->getController()->isPlayerController())
player_kart = kart;

View File

@ -60,8 +60,12 @@ void EmergencyAnimation::reset()
// Create the stars effect in the first reset
if(!m_stars_effect)
m_stars_effect = new Stars(m_kart->getNode(),
core::vector3df(0.0f, m_kart->getKartModel()->getModel()->getBoundingBox().MaxEdge.Y, 0.0f));
m_stars_effect =
new Stars(m_kart->getNode(),
core::vector3df(0.0f,
m_kart->getKartModel()->getModel()
->getBoundingBox().MaxEdge.Y,
0.0f) );
// Reset star effect in case that it is currently being shown.
m_stars_effect->reset();
@ -117,7 +121,7 @@ void EmergencyAnimation::forceRescue(bool is_auto_rescue)
m_up_velocity = m_kart->getKartProperties()->getRescueHeight() / m_timer;
m_xyz = m_kart->getXYZ();
m_kart->attach(Attachment::ATTACH_TINYTUX, m_timer);
m_kart->getAttachment()->set(Attachment::ATTACH_TINYTUX, m_timer);
m_curr_rotation.setPitch(m_kart->getPitch());
m_curr_rotation.setRoll(m_kart->getRoll() );

View File

@ -265,10 +265,6 @@ public:
/** Sets the kart properties. */
void setKartProperties(const KartProperties *kp) { m_kart_properties=kp; }
// ------------------------------------------------------------------------
/** Sets the attachment and time it stays attached. */
void attach(Attachment::AttachmentType attachment, float time)
{ m_attachment->set(attachment, time); }
// ------------------------------------------------------------------------
/** Sets a new powerup. */
void setPowerup (PowerupManager::PowerupType t, int n)
{ m_powerup.set(t, n); }