Slow down arrows in water (#5350)

* Slow down arrow in water

* Added myself to contributors
This commit is contained in:
Persson-dev 2021-12-19 20:58:55 +01:00 committed by GitHub
parent 2cd7e63e87
commit 640fbbbd92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View File

@ -61,6 +61,7 @@ nesco
NiLSPACE (formerly STR_Warrior)
npresley0506
p-mcgowan
Persson-dev
pokechu22
ProjectBM
pwnOrbitals

View File

@ -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
}
}

View File

@ -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 */