From 002498c33dc0e2397b2227181a199e66e01c90d4 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Sat, 8 May 2021 18:59:52 +0200 Subject: [PATCH] framerate-independent turning of player-model in multiplayer menu fixes #701 --- src/client/menu/menu.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/client/menu/menu.c b/src/client/menu/menu.c index 270be5f7..5efd661b 100644 --- a/src/client/menu/menu.c +++ b/src/client/menu/menu.c @@ -4758,7 +4758,6 @@ PlayerConfig_MenuDraw(void) if (s_pmi[s_player_model_box.curvalue].skindisplaynames) { - static int yaw; entity_t entity; char scratch[MAX_QPATH]; @@ -4780,12 +4779,11 @@ PlayerConfig_MenuDraw(void) entity.frame = 0; entity.oldframe = 0; entity.backlerp = 0.0; - entity.angles[1] = (float)yaw; - if (++yaw > 360) - { - yaw -= 360; - } + int curTime = Sys_Milliseconds(); + // one full turn is 3s = 3000ms => 3000/360 deg per millisecond + curTime = curTime % 3000; + entity.angles[1] = (float)curTime/(3000.0f/360.0f); refdef.areabits = 0; refdef.num_entities = 1;