From 8c291fdfe3d06f9de8b5a926faf58c0cede3ef86 Mon Sep 17 00:00:00 2001 From: xiaodo <1079114958@qq.com> Date: Sat, 5 Oct 2024 03:23:02 +0800 Subject: [PATCH] engine: fix CenterPrint Wrong Y Position. --- engine/client/cl_game.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/engine/client/cl_game.c b/engine/client/cl_game.c index 056c7a8b..c5fd127a 100644 --- a/engine/client/cl_game.c +++ b/engine/client/cl_game.c @@ -283,19 +283,19 @@ static int CL_AdjustYPos( float y, int height ) if( y == -1 ) // centered? { - yPos = ( refState.height - height ) * 0.5f; + yPos = (clgame.scrInfo.iHeight - height ) * 0.5f; } else { // Alight bottom? if( y < 0 ) - yPos = (1.0f + y) * refState.height - height; // Alight bottom + yPos = (1.0f + y) * clgame.scrInfo.iHeight - height; // Alight bottom else // align top - yPos = y * refState.height; + yPos = y * clgame.scrInfo.iHeight; } - if( yPos + height > refState.height ) - yPos = refState.height - height; + if( yPos + height > clgame.scrInfo.iHeight) + yPos = clgame.scrInfo.iHeight - height; else if( yPos < 0 ) yPos = 0;