mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-09 22:38:06 -05:00
Disable static value evaluation for visible expression when optimizations are turned off
This commit is contained in:
@ -493,10 +493,23 @@ namespace IW4
|
||||
if (expression == nullptr)
|
||||
return nullptr;
|
||||
|
||||
if (expression->IsStatic())
|
||||
bool isStatic;
|
||||
bool isTruthy;
|
||||
if(m_disable_optimizations)
|
||||
{
|
||||
const auto staticValue = expression->Evaluate();
|
||||
if (staticValue.IsTruthy())
|
||||
const auto* staticValue = dynamic_cast<const SimpleExpressionValue*>(expression);
|
||||
isStatic = staticValue != nullptr;
|
||||
isTruthy = isStatic && staticValue->IsTruthy();
|
||||
}
|
||||
else
|
||||
{
|
||||
isStatic = expression->IsStatic();
|
||||
isTruthy = isStatic && expression->Evaluate().IsTruthy();
|
||||
}
|
||||
|
||||
if (isStatic)
|
||||
{
|
||||
if (isTruthy)
|
||||
window->dynamicFlags[0] |= WINDOW_FLAG_VISIBLE;
|
||||
return nullptr;
|
||||
}
|
||||
|
Reference in New Issue
Block a user