Replace deprecated string.find() amd string.lower() in /python/*.py
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@11452 282e977c-c81d-0410-88c4-b93c2d0d6712master
parent
f312f10445
commit
c589e07ec3
|
@ -275,7 +275,7 @@ class Dialog:
|
|||
# only need to be a substring of the message in order to trigger a reply.
|
||||
def isAnswer(self, msg, keywords):
|
||||
for ckey in keywords:
|
||||
if ckey == "*" or string.find(msg.lower(), ckey.lower()) != -1:
|
||||
if ckey == "*" or msg.lower().find(ckey.lower()) != -1:
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ bigmapysize = 50
|
|||
#Return an x,y tuple of where in bigworld an object is. Return false if not in bigworld. In current bigworld, values range from 5000 to 6499.
|
||||
def loc_from_ob(ob):
|
||||
cfmap = ob.Map
|
||||
if ((string.find(cfmap.Path,world_prefix) != 0) or (len(cfmap.Path) != world_len)):
|
||||
if ((cfmap.Path.find(world_prefix) != 0) or (len(cfmap.Path) != world_len)):
|
||||
return False
|
||||
strloc = cfmap.Path[world_prefix_len:].split(world_sep)
|
||||
x = (int(strloc[0]) * bigmapxsize) + ob.X
|
||||
|
|
Loading…
Reference in New Issue