Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 11th, 2012  |  syntax: Lua  |  size: 0.56 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. for i,loc in ipairs(wesnoth.get_locations {}) do
  2.         local item_var = "item" .. "_" .. loc[1] .. "_" .. loc[2]
  3.        
  4.         if item_var ~= nil
  5.             then
  6.  
  7.  
  8.             if wesnoth.get_variable(item_var .. ".scenario") == wesnoth.get_variable("scenario")
  9.                 then
  10.                         local item_type = wesnoth.get_variable(item_var .. ".type")
  11.                        
  12.                         local image_path = wesnoth.get_variable("items." .. item_type .. ".ground_icon")
  13.                        
  14.                         local items = wesnoth.require "lua/wml/items.lua"
  15.                         items.place_image(loc[1], loc[2], image_path)  
  16.             end
  17.         end
  18.        
  19. end