fix: crash on cs_office
visibility check is disabled on cs_office because of a crash in the parser, not my fault
This commit is contained in:
@@ -160,7 +160,7 @@
|
|||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||||
<AdditionalOptions>/ignore:4099 %(AdditionalOptions)</AdditionalOptions>
|
<AdditionalOptions>/ignore:4099 %(AdditionalOptions)</AdditionalOptions>
|
||||||
<AdditionalDependencies>valve-bsp-parser.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>valve-bsp-parser.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
|||||||
@@ -75,6 +75,10 @@ void Draw() {
|
|||||||
RGBA Cyan = { 0, 231, 255, 255 };
|
RGBA Cyan = { 0, 231, 255, 255 };
|
||||||
if (crosshair) DrawCircleFilled(Process::WindowWidth/2, Process::WindowHeight/2, 3, &Cyan);
|
if (crosshair) DrawCircleFilled(Process::WindowWidth/2, Process::WindowHeight/2, 3, &Cyan);
|
||||||
|
|
||||||
|
if (!Game::client || !Game::engine) {
|
||||||
|
init_modules();
|
||||||
|
}
|
||||||
|
|
||||||
char map_name[256];
|
char map_name[256];
|
||||||
static bool parsed_map = false;
|
static bool parsed_map = false;
|
||||||
static std::string map_name_old = "";
|
static std::string map_name_old = "";
|
||||||
@@ -87,6 +91,8 @@ void Draw() {
|
|||||||
map_name[j] = c;
|
map_name[j] = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (map_name[0] == '\0')
|
||||||
|
return;
|
||||||
if (std::string(map_name) != map_name_old || !parsed_map) {
|
if (std::string(map_name) != map_name_old || !parsed_map) {
|
||||||
parsed_map = _bsp_parser.load_map(std::string(Game::path) + std::string("cstrike\\maps"), map_name);
|
parsed_map = _bsp_parser.load_map(std::string(Game::path) + std::string("cstrike\\maps"), map_name);
|
||||||
map_name_old = std::string(map_name);
|
map_name_old = std::string(map_name);
|
||||||
@@ -97,9 +103,6 @@ void Draw() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
RGBA White = { 255, 255, 255, 255 };
|
RGBA White = { 255, 255, 255, 255 };
|
||||||
if (!Game::client || !Game::engine) {
|
|
||||||
init_modules();
|
|
||||||
}
|
|
||||||
|
|
||||||
uintptr_t entity_list = Game::client + ENTITY_LIST;
|
uintptr_t entity_list = Game::client + ENTITY_LIST;
|
||||||
uintptr_t localplayer = RPM<uintptr_t>(Game::client + LOCALPLAYER);
|
uintptr_t localplayer = RPM<uintptr_t>(Game::client + LOCALPLAYER);
|
||||||
@@ -134,7 +137,9 @@ void Draw() {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_visible = _bsp_parser.is_visible(vector3{ pos.x, pos.y, pos.z + 66 }, vector3{ absOrigin.x, absOrigin.y, absOrigin.z + 66 });
|
bool is_visible = true;
|
||||||
|
if (parsed_map && std::string(map_name) != "cs_office.bsp")
|
||||||
|
is_visible = _bsp_parser.is_visible(vector3{pos.x, pos.y, pos.z + 66}, vector3{absOrigin.x, absOrigin.y, absOrigin.z + 66});
|
||||||
|
|
||||||
//getting name
|
//getting name
|
||||||
DWORD list = RPM<DWORD>(Game::client + NAME_LIST) + 0x38;
|
DWORD list = RPM<DWORD>(Game::client + NAME_LIST) + 0x38;
|
||||||
|
|||||||
Reference in New Issue
Block a user