VarAction2: Extend group cast to bool range elision

Handle opposite arrangement of range and default group
This commit is contained in:
Jonathan G Rennison 2022-08-22 21:52:15 +01:00
parent df6b9d355f
commit d9aa2d6138

View File

@ -2250,6 +2250,10 @@ void OptimiseVarAction2DeterministicSpriteGroup(VarAction2OptimiseState &state,
group->default_group != nullptr && group->default_group->type == SGT_CALLBACK && static_cast<const CallbackResultSpriteGroup*>(group->default_group)->result == 1) {
group->calculated_result = true;
group->ranges.clear();
} else if (r0.low == 1 && r0.high == 1 && r0.group != nullptr && r0.group->type == SGT_CALLBACK && static_cast<const CallbackResultSpriteGroup*>(r0.group)->result == 1 &&
group->default_group != nullptr && group->default_group->type == SGT_CALLBACK && static_cast<const CallbackResultSpriteGroup*>(group->default_group)->result == 0) {
group->calculated_result = true;
group->ranges.clear();
}
}