Update of /cvsroot/wpdev/xmlscripts/scripts/commands
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13778/commands
Modified Files:
tele.py wipe.py
Log Message:
Fixes, though I found a bug with item iteration...
Index: tele.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/tele.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** tele.py 7 Sep 2004 23:43:02 -0000 1.2
--- tele.py 23 Sep 2004 00:27:55 -0000 1.3
***************
*** 6,10 ****
import wolfpack
from wolfpack import utilities
- from wolfpack.consts import *
def onLoad():
--- 6,9 ----
***************
*** 31,34 ****
char.socket.resendworld()
utilities.smokepuff(char, source)
! utilities.smokepuff(char, target)
return True
--- 30,33 ----
char.socket.resendworld()
utilities.smokepuff(char, source)
! utilities.smokepuff(char, target)
return True
Index: wipe.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/wipe.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** wipe.py 21 Sep 2004 12:36:11 -0000 1.6
--- wipe.py 23 Sep 2004 00:27:55 -0000 1.7
***************
*** 33,40 ****
import wolfpack.gumps
from wolfpack.gumps import WarningGump
! from wolfpack.utilities import *
def getBoundingBox( socket, callback ) :
socket.attachtarget( "commands.wipe.getBoundingBoxResponse", [0, callback] )
def getBoundingBoxResponse( char, args, target ):
--- 33,41 ----
import wolfpack.gumps
from wolfpack.gumps import WarningGump
! #from wolfpack.utilities import *
def getBoundingBox( socket, callback ) :
socket.attachtarget( "commands.wipe.getBoundingBoxResponse", [0, callback] )
+ return
def getBoundingBoxResponse( char, args, target ):
***************
*** 43,47 ****
else:
args[1]( char.socket, args[2], target )
!
def nuke( socket, command, argstring ):
--- 44,48 ----
else:
args[1]( char.socket, args[2], target )
! return
def nuke( socket, command, argstring ):
***************
*** 64,68 ****
iterator = wolfpack.itemiterator()
item = iterator.first
! count = 0;
while item:
if item.container == None:
--- 65,69 ----
iterator = wolfpack.itemiterator()
item = iterator.first
! count = 0
while item:
if item.container == None:
***************
*** 71,90 ****
item = iterator.next
player.socket.sysmessage( "%i items have been removed from world" % count )
def wipeBoundingBox( socket, target1, target2 ):
! x1 = min(target1.pos.x, target2.pos.x)
! x2 = max(target1.pos.x, target2.pos.x)
! y1 = min(target1.pos.y, target2.pos.y)
! y2 = max(target1.pos.y, target2.pos.y)
!
! count = 0
! iterator = wolfpack.itemregion( x1, y1, x2, x2, target2.pos.map )
item = iterator.first
while item:
item.delete()
item = iterator.next
- count += 1;
-
socket.sysmessage( "%i items removed" % count )
return 1
--- 72,94 ----
item = iterator.next
player.socket.sysmessage( "%i items have been removed from world" % count )
+ return
def wipeBoundingBox( socket, target1, target2 ):
! if target1.pos.map != target2.pos.map:
! return False
! x1 = min( target1.pos.x, target2.pos.x )
! x2 = max( target1.pos.x, target2.pos.x )
! y1 = min( target1.pos.y, target2.pos.y )
! y2 = max( target1.pos.y, target2.pos.y )
!
! iterator = wolfpack.itemregion( x1, y1, x2, y2, target2.pos.map )
item = iterator.first
+ count = 0
while item:
item.delete()
+ count += 1
item = iterator.next
socket.sysmessage( "%i items removed" % count )
+
return 1
***************
*** 92,93 ****
--- 96,98 ----
wolfpack.registercommand( "wipe", nuke )
wolfpack.registercommand( "nuke", nuke )
+ return
|