mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 15:14:52 +09:00
Do not add empty array for recipe notifications
This commit is contained in:
1 file changed
+4
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user