Minor code cleanup in some python modules (removing unused variables, cleaning up some if tests, removing import statements for some modules that were then never used.

git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@12197 282e977c-c81d-0410-88c4-b93c2d0d6712
master
anmaster 2009-10-14 16:13:29 +00:00
parent 20f781ce95
commit a8cab01c4b
4 changed files with 4 additions and 5 deletions

View File

@ -18,7 +18,6 @@
#
import os
import string
import Crossfire
class CFDataFile:

View File

@ -58,6 +58,7 @@ def MakeIdentifier(key):
class CFMapTransformer:
key = None
cfmap = None
def __init__(self,key,cfmap=None):
self.key=key
if (cfmap):
@ -69,7 +70,6 @@ class CFMapTransformer:
self.cfmap = o.Map
def transformAll(self, criteria, whatTo):
mustClean = False
if (not isinstance (criteria,list)):
criteria = [criteria]
for x in range (self.cfmap.Width):
@ -94,6 +94,7 @@ class CFMapTransformer:
force.WriteKey("inside_speed","%f" %top.Speed,1)
top.Speed = 0
top=next
def untransformAll(self):
for x in range(self.cfmap.Width):
for y in range(self.cfmap.Height):

View File

@ -1,6 +1,5 @@
#CFWorld.py
#A small module for checking where is bigworld an object is if it's in bigworld.
import string
import Crossfire
world_prefix = "/world/world_"

View File

@ -59,7 +59,7 @@ def handle_move():
y = me.Y
for check in [0, 1, -1]:
d = abs_dir(want_dir + check)
if has_floor(x + dir_x[d], y + dir_y[d], floor) == True:
if has_floor(x + dir_x[d], y + dir_y[d], floor):
if me.Move(d) == 0:
continue
@ -68,7 +68,7 @@ def handle_move():
done = True
break
if done == False:
if not done:
me.WriteKey(key_direction, '', 1)
me.WriteKey(key_follow, '', 1)
return