|
1 | 1 | #include "cbase.h" |
2 | 2 | #include "asw_input.h" |
3 | 3 | #include "vgui/asw_vgui_ingame_panel.h" |
| 4 | +#include "asw_hud_master.h" |
4 | 5 | #include "asw_hud_crosshair.h" |
5 | 6 | #include "c_asw_player.h" |
6 | 7 | #include "c_asw_marine.h" |
|
15 | 16 | // memdbgon must be the last include file in a .cpp file!!! |
16 | 17 | #include "tier0/memdbgon.h" |
17 | 18 |
|
18 | | -// restricted area variables |
19 | | -extern int g_nRestrictedAreaLeft; |
20 | | -extern int g_nRestrictedAreaRight; |
21 | | -extern int g_nScreenAreaWidth; |
22 | | -extern int g_nScreenAreaHeight; |
23 | | -extern bool g_bUltraWideScreen; |
24 | | - |
25 | 19 | ConVar glow_outline_color_active( "glow_outline_color_active", "153 153 204", FCVAR_NONE ); |
26 | 20 | ConVar glow_outline_color_inactive( "glow_outline_color_inactive", "77 77 77", FCVAR_NONE ); |
27 | 21 |
|
@@ -92,17 +86,15 @@ void CASWInput::ApplyMouse( int nSlot, QAngle& viewangles, CUserCmd *cmd, float |
92 | 86 | int current_posx, current_posy; |
93 | 87 | GetMousePos(current_posx, current_posy); |
94 | 88 |
|
95 | | - // restrict cursor to 16:9 area to prevent ultra-wide fov cheat |
96 | | - C_ASW_Player* asw_player = C_ASW_Player::GetLocalASWPlayer(); |
| 89 | + if ( ASWInput()->ControllerModeActiveMouse() ) |
| 90 | + return; |
97 | 91 |
|
98 | | - if (asw_player && !asw_player->GetSpectatingNPC()) |
| 92 | + CASW_Hud_Master *pHUDMaster = GET_HUDELEMENT( CASW_Hud_Master ); |
| 93 | + if ( pHUDMaster ) |
99 | 94 | { |
100 | | - current_posx = clamp(current_posx, g_nRestrictedAreaLeft, g_nRestrictedAreaRight); |
| 95 | + current_posx = clamp( current_posx, pHUDMaster->m_nMouseMinX, pHUDMaster->m_nMouseMaxX ); |
101 | 96 | } |
102 | 97 |
|
103 | | - if ( ASWInput()->ControllerModeActiveMouse() ) |
104 | | - return; |
105 | | - |
106 | 98 | if ( MarineControllingTurret() ) |
107 | 99 | { |
108 | 100 | // accelerate up the mouse intertia |
|
0 commit comments