fix(Protections): Fixed how the reset protections is handled (#1745)

This commit is contained in:
Sixhei Tartari 2023-07-18 09:59:20 +02:00 committed by GitHub
parent 911a3b71e7
commit d1a8022eb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,10 +8,13 @@ namespace big
*(bool*)i = state; *(bool*)i = state;
} }
static inline void reset_protections()
{
g.protections = {};
}
void view::protection_settings() void view::protection_settings()
{ {
auto initial_protections = g.protections;
ImGui::BeginGroup(); ImGui::BeginGroup();
ImGui::Checkbox("BOUNTY"_T.data(), &g.protections.script_events.bounty); ImGui::Checkbox("BOUNTY"_T.data(), &g.protections.script_events.bounty);
ImGui::Checkbox("CEO_MONEY"_T.data(), &g.protections.script_events.ceo_money); ImGui::Checkbox("CEO_MONEY"_T.data(), &g.protections.script_events.ceo_money);
@ -65,7 +68,7 @@ namespace big
set_all_protections(false); set_all_protections(false);
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Reset Protections")) if (ImGui::Button("Reset Protections"))
g.protections = initial_protections; reset_protections();
ImGui::EndGroup(); ImGui::EndGroup();
}; };
} }