fix: Submarine crash and allowing empty JSON filenames to be saved (#2380)

This commit is contained in:
gir489 2023-11-05 07:54:15 -05:00 committed by GitHub
parent 1263f26dc1
commit 864e15a0bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View File

@ -12,7 +12,8 @@ namespace big
virtual void execute(const command_arguments&, const std::shared_ptr<command_context> ctx) override
{
Vehicle veh = mobile::mechanic::get_personal_vehicle();
teleport::into_vehicle(veh);
if (self::veh != veh)
teleport::into_vehicle(veh);
}
};

View File

@ -1557,6 +1557,11 @@ namespace big
}
}
}
if (!NETWORK::NETWORK_IS_ACTIVITY_SESSION()) //If we're in Freemode.
{
notify::crash_blocked(sender, "submarine car freemode");
return true;
}
}
break;

View File

@ -184,6 +184,9 @@ namespace big
ImGui::SetTooltip("VEHICLE_FOLDER_NAME_EXAMPLE"_T.data());
components::button("SAVE_VEHICLE"_T, [] {
if (vehicle_file_name_input[0] == '\0')
return;
if (!self::veh)
return g_notification_service->push_warning("PERSIST_CAR"_T.data(), "PERSIST_CAR_NOT_IN_VEHICLE"_T.data());
@ -193,6 +196,9 @@ namespace big
else
{
components::button("SAVE_VEHICLE"_T, [] {
if (vehicle_file_name_input[0] == '\0')
return;
if (!self::veh)
return g_notification_service->push_warning("PERSIST_CAR"_T.data(), "PERSIST_CAR_NOT_IN_VEHICLE"_T.data());