From 7a85eb9c9cbcbb8573da1dc944082f465da5d99a Mon Sep 17 00:00:00 2001 From: Joelrau Date: Thu, 23 Jul 2020 06:36:14 +0300 Subject: [PATCH] [Maps] Added dvar 'r_specularCustomMaps' + dvar 'r_specularCustomMaps' (Allows shaders to use phong specular lighting on custom maps) --- src/Components/Modules/Maps.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Components/Modules/Maps.cpp b/src/Components/Modules/Maps.cpp index d03dc924..7c18c8df 100644 --- a/src/Components/Modules/Maps.cpp +++ b/src/Components/Modules/Maps.cpp @@ -682,12 +682,16 @@ namespace Components Game::dvar_t* Maps::GetSpecularDvar() { Game::dvar_t*& r_specular = *reinterpret_cast(0x69F0D94); + static Game::dvar_t* r_specularCustomMaps = Game::Dvar_RegisterBool("r_specularCustomMaps", true, Game::DVAR_FLAG_SAVED, "Allows shaders to use phong specular lighting on custom maps"); if (Maps::IsCustomMap()) { - static Game::dvar_t noSpecular; - ZeroMemory(&noSpecular, sizeof noSpecular); - return &noSpecular; + if (!r_specularCustomMaps->current.enabled) + { + static Game::dvar_t noSpecular; + ZeroMemory(&noSpecular, sizeof noSpecular); + return &noSpecular; + } } return r_specular;