Crypton3
Retired
- Joined
- Mar 13, 2010
- Messages
- 549
- Reaction score
- 139
Simple and useful function for executing other function on all tiles of specified area.
Usage:
Sends magic effect on all tiles of the area.
@ down
Yeah, I forgot about it. It'll be a bit faster now
Code:
function Position.iterateArea(func, from, to)
for z = to.z, from.z do
for y = from.y, to.y do
for x = from.x, to.x do
func(Position(x, y, z))
end
end
end
end
Usage:
Code:
Position.iterateArea(function(position)
position:sendMagicEffect(CONST_ME_POFF)
end, {x = 1000, y = 980, z = 8}, {x = 1100, y = 990, z = 8})
@ down
Yeah, I forgot about it. It'll be a bit faster now
Last edited: