Модуль:Песочница/Pok: различия между версиями

мНет описания правки
мНет описания правки
Строка 85: Строка 85:
                 if cargo.gifts then
                 if cargo.gifts then
                     for giftId, giftValue in pairs(cargo.gifts) do
                     for giftId, giftValue in pairs(cargo.gifts) do
                         local productFound = nil
                         local product = nil
                         for _, cargoItem in ipairs(cargoData) do
                         for _, cargoItem in ipairs(cargoData) do
                             if cargoItem.id == giftId then
                             if cargoItem.id == giftId then
                                 productFound = cargoItem.product
                                 product = cargoItem.product
                                 break
                                 break
                             end
                             end
                         end
                         end
                         if productFound then
                         if not product then
                             giftsCell = giftsCell .. "- " .. productFound .. ": x" .. giftValue .. "<br>"
                             product = giftId
                        else
                            giftsCell = giftsCell .. "- {{#invoke:Entity Lookup|getname|" .. giftId .. "}}: x" .. giftValue .. "<br>"
                         end
                         end
                        giftsCell = giftsCell .. "- " .. product .. ": x" .. giftValue .. "<br>"
                     end
                     end
                 else
                 else