# HG changeset patch
# User Jordon Moss <mossj32@gmail.com>
# Date 1572988317 14400
#      Tue Nov 05 17:11:57 2019 -0400
# Node ID 020b76f4c8c85fcf3a43c333ac381076a96a0480
# Parent  b77c2343a4644cfe648015323f6373715f25d201
Fixed model interpolation in a less invasive way than my previous patches.

diff -r b77c2343a464 -r 020b76f4c8c8 src/gl/models/gl_models.cpp
--- a/src/gl/models/gl_models.cpp	Tue Oct 15 01:14:19 2019 -0300
+++ b/src/gl/models/gl_models.cpp	Tue Nov 05 17:11:57 2019 -0400
@@ -699,14 +699,13 @@
 			// [BB] In case the tic counter is frozen we have to leave ticFraction at zero.
 			if ( ConsoleState == c_up && menuactive != MENU_On && !(level.flags2 & LEVEL2_FROZEN) )
 			{
-				float time = GetTimeFloat();
-				ticFraction = (time - static_cast<int>(time));
+				ticFraction = FIXED2FLOAT(I_GetTimeFrac(NULL)); // [JM] Model Interp Fix
 			}
-			inter = static_cast<double>(curState->Tics - curTics - ticFraction)/static_cast<double>(curState->Tics);
+			inter = static_cast<double>(curState->Tics - curTics + ticFraction) / static_cast<double>(curState->Tics); // [JM] Model Interp Fix
 
 			// [BB] For some actors (e.g. ZPoisonShroom) spr->actor->tics can be bigger than curState->Tics.
 			// In this case inter is negative and we need to set it to zero.
-			if ( inter < 0. )
+			if (curState->Tics < curTics) // [JM] Model Interp Fix
 				inter = 0.;
 			else
 			{
