First implementation for furnace minecarts.
This commit is contained in:
parent
d23e743303
commit
bdfe31f917
@ -766,7 +766,10 @@ void cMinecartWithFurnace::OnRightClicked(cPlayer & a_Player)
|
||||
{
|
||||
a_Player.GetInventory().RemoveOneEquippedItem();
|
||||
}
|
||||
|
||||
if (!m_IsFueled) // We don't want to change the direction by right clicking it.
|
||||
{
|
||||
AddSpeed(a_Player.GetLookVector().x, 0, a_Player.GetLookVector().z);
|
||||
}
|
||||
m_IsFueled = true;
|
||||
m_World->BroadcastEntityMetadata(*this);
|
||||
}
|
||||
@ -776,6 +779,24 @@ void cMinecartWithFurnace::OnRightClicked(cPlayer & a_Player)
|
||||
|
||||
|
||||
|
||||
void cMinecartWithFurnace::Tick(float a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
|
||||
if (m_IsFueled)
|
||||
{
|
||||
if (GetSpeed().Length() > 6)
|
||||
{
|
||||
return;
|
||||
}
|
||||
AddSpeed(GetSpeed() / 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// cMinecartWithTNT:
|
||||
|
||||
|
@ -151,6 +151,7 @@ public:
|
||||
|
||||
// cEntity overrides:
|
||||
virtual void OnRightClicked(cPlayer & a_Player) override;
|
||||
virtual void Tick(float a_Dt, cChunk & a_Chunk) override;
|
||||
bool IsFueled (void) const { return m_IsFueled; }
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user