[wpdev-commits] xmlscripts/scripts/commands tile.py,1.3,1.4
Brought to you by:
rip,
thiagocorrea
From: Sebastian H. <dar...@us...> - 2004-09-03 15:32:33
|
Update of /cvsroot/wpdev/xmlscripts/scripts/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5731/commands Modified Files: tile.py Log Message: Resolved bug #0000260 Index: tile.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/tile.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tile.py 23 Aug 2004 03:10:39 -0000 1.3 --- tile.py 3 Sep 2004 15:32:24 -0000 1.4 *************** *** 10,13 **** --- 10,14 ---- import wolfpack + from wolfpack.consts import * import random *************** *** 27,32 **** z = arguments[0] ids = arguments[1] ! player.socket.sysmessage('Creating items from %u,%u to %u,%u at z=%d.' % (x1, y1, x2, y2, z)) pos = player.pos pos.z = z --- 28,42 ---- z = arguments[0] ids = arguments[1] + + unlimited = player.account.authorized('Misc', 'Unlimited Tile') + count = ((x2 - x1) + 1) * ((y2 - y1) + 1) + + # Cap at 500 items if not an admin is using it + if not unlimited and count > 250: + player.socket.sysmessage('You are not allowed to tile more than 250 items at once.') + return ! player.log(LOG_MESSAGE, "Tiling %u items (%s) from %u,%u to %u,%u at z=%d.\n" % (count, ", ".join(ids), x1, y1, x2, y2, z)) ! player.socket.sysmessage('Creating %u items from %u,%u to %u,%u at z=%d.' % (count, x1, y1, x2, y2, z)) pos = player.pos pos.z = z |