From d1e118f07ce9b73d65d5bd99cbe308623d1d53bc Mon Sep 17 00:00:00 2001 From: xiaodoxd Date: Sat, 5 Oct 2024 01:02:41 +0800 Subject: [PATCH] Fix CenterPrint Wrong X 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 8a8f01ff..056c7a8b 100644 --- a/engine/client/cl_game.c +++ b/engine/client/cl_game.c @@ -252,18 +252,18 @@ static int CL_AdjustXPos( float x, int width, int totalWidth ) if( x == -1 ) { - xPos = ( refState.width - width ) * 0.5f; + xPos = ( clgame.scrInfo.iWidth - width ) * 0.5f; } else { if ( x < 0 ) - xPos = (1.0f + x) * refState.width - totalWidth; // Alight right + xPos = (1.0f + x) * clgame.scrInfo.iWidth - totalWidth; // Alight right else // align left - xPos = x * refState.width; + xPos = x * clgame.scrInfo.iWidth; } - if( xPos + width > refState.width ) - xPos = refState.width - width; + if( xPos + width > clgame.scrInfo.iWidth) + xPos = clgame.scrInfo.iWidth - width; else if( xPos < 0 ) xPos = 0;