Skip to content

Commit

Permalink
Merge branch 'all-in-one-vs2022' into all-in-one-vs2022-wpo
Browse files Browse the repository at this point in the history
  • Loading branch information
themrdemonized committed Dec 11, 2024
2 parents b574ed1 + 66f5d26 commit 5b93073
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ How to compile exes:
6. For successful compilation, **the latest build tools with MFC and ATL libraries is required**
## Changelog
**2024.12.11**
* Fix of "Fail to detach scope from some weapons" (https://github.com/themrdemonized/xray-monolith/issues/114)
**2024.12.10**
* momopate (https://github.com/themrdemonized/xray-monolith/pull/112):
* Added console commands:
Expand Down
10 changes: 10 additions & 0 deletions src/xrGame/Weapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ float CWeapon::SDS_Radius(bool alt) {
else
{
scope_tex_name = alt ? m_secondary_scope_tex_name : m_primary_scope_tex_name;

// demonized: ugly hack to fix stuck scope texture on old scopes system
if (!READ_IF_EXISTS(pSettings, r_string, cNameSect(), "scope_texture", NULL)) {
scope_tex_name = NULL;
}
}

if (scope_tex_name != 0) {
Expand Down Expand Up @@ -369,6 +374,11 @@ void CWeapon::UpdateUIScope()
m_primary_scope_tex_name = READ_IF_EXISTS(pSettings, r_string, cNameSect(), "scope_texture", NULL);
}
scope_tex_name = m_primary_scope_tex_name;

// demonized: ugly hack to fix stuck scope texture on old scopes system
if (!READ_IF_EXISTS(pSettings, r_string, cNameSect(), "scope_texture", NULL)) {
scope_tex_name = NULL;
}
}
}
else if (m_zoomtype == 1)
Expand Down

0 comments on commit 5b93073

Please sign in to comment.