Slow down arrows in water (#5350)
* Slow down arrow in water * Added myself to contributors
This commit is contained in:
parent
2cd7e63e87
commit
640fbbbd92
@ -61,6 +61,7 @@ nesco
|
||||
NiLSPACE (formerly STR_Warrior)
|
||||
npresley0506
|
||||
p-mcgowan
|
||||
Persson-dev
|
||||
pokechu22
|
||||
ProjectBM
|
||||
pwnOrbitals
|
||||
|
@ -194,6 +194,10 @@ void cArrowEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
m_IsInGround = false; // Yes, begin simulating physics again
|
||||
}
|
||||
}
|
||||
else if (IsInWater()) // Arrow in water?
|
||||
{
|
||||
ApplyFriction(m_Speed, ARROW_WATER_FRICTION, static_cast<float>(a_Dt.count())); // Yes, slow down arrow
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -39,6 +39,8 @@ public:
|
||||
|
||||
// tolua_end
|
||||
|
||||
static constexpr float ARROW_WATER_FRICTION = 50.0f; ///< Value used to calculate arrow speed in water
|
||||
|
||||
CLASS_PROTODEF(cArrowEntity)
|
||||
|
||||
/** Creates a new arrow with psNoPickup state and default damage modifier coeff */
|
||||
|
Loading…
x
Reference in New Issue
Block a user