[wpdev-commits] xmlscripts/scripts/wolfpack/commands import.py,1.3,1.4
Brought to you by:
rip,
thiagocorrea
|
From: <ri...@us...> - 2003-09-01 20:39:18
|
Update of /cvsroot/wpdev/xmlscripts/scripts/wolfpack/commands
In directory sc8-pr-cvs1:/tmp/cvs-serv28237/scripts/wolfpack/commands
Modified Files:
import.py
Log Message:
import fixes
Index: import.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/commands/import.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** import.py 26 Aug 2003 03:53:05 -0000 1.3
--- import.py 1 Sep 2003 20:39:14 -0000 1.4
***************
*** 122,127 ****
line = line.replace( "\n", "" )
! # SECTION WORLDITEM : 18 byte (including space)
! if line[:18] == 'SECTION WORLDITEM ':
item = {}
--- 122,127 ----
line = line.replace( "\n", "" )
! # SECTION WORLDITEM : 17 byte
! if line[:17] == 'SECTION WORLDITEM':
item = {}
***************
*** 152,167 ****
if not item.has_key( 'ID' ):
! warnings += 'Item (%s) has no ID property. Skipping.' % ( serial )
continue
id = int( item['ID'] )
! if not item.has_key( 'X' ) or not item.has_key( 'Y' ) or not item.has_key( 'Z' ):
! warnings += 'Item (Serial: %s, ID: %x) has no X,Y or Z property. Skipping.' % ( serial, id )
continue
!
! x = int( item['X'] )
! y = int( item['Y'] )
! z = int( item['Z'] )
color = 0
--- 152,172 ----
if not item.has_key( 'ID' ):
! warnings += 'Item (%s) has no ID property. Skipping.<br>' % ( serial )
continue
id = int( item['ID'] )
! if not item.has_key( 'X' ) or not item.has_key( 'Y' ):
! warnings += 'Item (Serial: %s, ID: %x) has no X or Y property. Skipping.<br>' % ( serial, id )
continue
! x = 0
! y = 0
! z = 0
! if item.has_key('X'):
! x = int( item['X'] )
! if item.has_key('Y'):
! y = int( item['Y'] )
! if item.has_key('Z'):
! z = int( item['Z'] )
color = 0
***************
*** 170,174 ****
if item.has_key( 'CONT' ) and item[ 'CONT' ] != '-1':
! warnings += 'Item (Serial: %s, ID: %x) is contained in container %s. Skipping' % ( serial, id, item[ 'CONT' ] )
continue
--- 175,179 ----
if item.has_key( 'CONT' ) and item[ 'CONT' ] != '-1':
! # warnings += 'Item (Serial: %s, ID: %x) is contained in container %s. Skipping' % ( serial, id, item[ 'CONT' ] )
continue
***************
*** 181,188 ****
name = item[ 'NAME' ]
! #warnings += 'Item %x, Color %x, Pos %i,%i,%i<br>' % ( id, color, x, y, z )
# REMEMBER: Set them to nodecay!!!
! newitem = wolfpack.newitem( 1 ) # Generate a new serial for us
newitem.decay = 0
--- 186,196 ----
name = item[ 'NAME' ]
! #print 'Item %x, Color %x, Pos %i,%i,%i<br>' % ( id, color, x, y, z )
# REMEMBER: Set them to nodecay!!!
! newitem = wolfpack.additem( "%x" % hex2dec( id ) ) # Generate a new serial for us
!
! if not newitem:
! newitem = wolfpack.newitem( 1 ) # Generate a new serial for us
newitem.decay = 0
***************
*** 190,194 ****
newitem.id = id
newitem.amount = amount
! newitem.name = name
newitem.moveto( x, y, z, map )
newitem.update()
--- 198,203 ----
newitem.id = id
newitem.amount = amount
! if name != "#":
! newitem.name = name
newitem.moveto( x, y, z, map )
newitem.update()
***************
*** 196,200 ****
count += 1
! elif line[:18] == 'SECTION WORLDCHAR ':
warning += "Found character in import file. Importing characters is not allowed.<br>"
--- 205,209 ----
count += 1
! elif line[:17] == 'SECTION WORLDCHAR':
warning += "Found character in import file. Importing characters is not allowed.<br>"
|