Don't call setLastTriggeredCheckline for check cannon

It will override the track check line
This commit is contained in:
Benau
2017-10-16 13:47:14 +08:00
parent 9f10676dd3
commit 7e0d706946
6 changed files with 9 additions and 2 deletions

View File

@@ -913,6 +913,8 @@ void IrrDriver::applyResolutionSettings()
// above) - this happens dynamically when the tracks are loaded.
GUIEngine::reshowCurrentScreen();
MessageQueue::updatePosition();
// Preload the explosion effects (explode.png)
ParticleKindManager::get()->getParticles("explosion.xml");
#endif // !SERVER_ONLY
} // applyResolutionSettings

View File

@@ -134,6 +134,8 @@ ParticleKind::ParticleKind(const std::string &file)
delete xml;
throw std::runtime_error("[ParticleKind] <material> tag has invalid 'file' attribute");
}
// Preload textures
getMaterial();
}
// ------------------------------------------------------------------------

View File

@@ -1461,6 +1461,8 @@ void initRest()
race_manager->setTrack(UserConfigParams::m_last_track);
// Preload the explosion effects (explode.png)
ParticleKindManager::get()->getParticles("explosion.xml");
} // initRest
//=============================================================================

View File

@@ -62,7 +62,7 @@ public:
virtual void trigger(unsigned int kart_index) OVERRIDE;
virtual void changeDebugColor(bool is_active) OVERRIDE;
virtual void update(float dt) OVERRIDE;
virtual bool triggeringCheckline() const { return false; }
void addFlyable(Flyable *flyable);
void removeFlyable(Flyable *flyable);
}; // CheckLine

View File

@@ -234,7 +234,7 @@ bool CheckLine::isTriggered(const Vec3 &old_pos, const Vec3 &new_pos,
if (result)
{
LinearWorld* lw = dynamic_cast<LinearWorld*>(w);
if (lw != NULL)
if (triggeringCheckline() && lw != NULL)
lw->setLastTriggeredCheckline(kart_index, m_index);
}
}

View File

@@ -86,6 +86,7 @@ public:
virtual void reset(const Track &track);
virtual void resetAfterKartMove(unsigned int kart_index);
virtual void changeDebugColor(bool is_active);
virtual bool triggeringCheckline() const { return true; }
// ------------------------------------------------------------------------
/** Returns the actual line data for this checkpoint. */
const core::line2df &getLine2D() const {return m_line;}