Do not add empty array for recipe notifications

This commit is contained in:
Cooldude2606 committed 2026-03-02 16:39:20 +00:00
1 parent 412c291193
commit 54557a79c5
1 file changed
+4 -1
+4 -1
View File
@@ -426,10 +426,13 @@ function serialize.serialize_player(player)
-- Serialize recipe notifications
if recipe_notifications_api then
local recipe_notifications = {}
serialized.recipe_notifications = recipe_notifications
for i, recipe in ipairs(player.get_recipe_notifications()) do
recipe_notifications[i] = recipe.name
end
if #recipe_notifications > 0 then
-- Do no add if length is zero as this breaks with table_to_json
serialized.recipe_notifications = recipe_notifications
end
end
return serialized