
Untitled
By: a guest on
May 11th, 2012 | syntax:
Lua | size: 0.56 KB | hits: 17 | expires: Never
for i,loc in ipairs(wesnoth.get_locations {}) do
local item_var = "item" .. "_" .. loc[1] .. "_" .. loc[2]
if item_var ~= nil
then
if wesnoth.get_variable(item_var .. ".scenario") == wesnoth.get_variable("scenario")
then
local item_type = wesnoth.get_variable(item_var .. ".type")
local image_path = wesnoth.get_variable("items." .. item_type .. ".ground_icon")
local items = wesnoth.require "lua/wml/items.lua"
items.place_image(loc[1], loc[2], image_path)
end
end
end