1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-15 14:09:06 +00:00

High framerate problem wasn't fully fixed, let's try this again.

Little addition to 7891a2f011.
This commit is contained in:
fgenesis 2013-06-23 22:41:35 +02:00
parent 7dca65351c
commit f8ed78d331

View file

@ -6977,7 +6977,11 @@ void Avatar::onUpdate(float dt)
{
/*collideCheck:*/
if (!isSwimming() && vel.getLength2D() < sqr(2))
// Beware: This code may cause clamping vel to zero if the framerate is very high.
// Starting with zero vel, low difftimes will cause an addVec small enough that this
// check will always trigger, and vel will never get larger than zero.
// Under water and swimming check should hopefully prevent this from happening. -- FG
if (_isUnderWater && !isSwimming() && vel.getLength2D() < sqr(2))
{
vel = Vector(0,0,0);
}