Replace two uses of dict.has_key() in python dialog scripts with use of "in" operator.

git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@20269 282e977c-c81d-0410-88c4-b93c2d0d6712
master
silvernexus 2016-05-21 03:50:17 +00:00
parent dad71b985b
commit a874adeb8a
3 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2016-05-20 23:45 Daniel Hawkins
* python/dialog/npc_dialog.py: Replace deprecated call to dict.has_key()
* python/CFDialog.py: Replace deprecated call to dict.has_key()
2016-05-17 17:26 Daniel Hawkins
* scorn/misc/HouseofHealing: Made the information books start identified.

View File

@ -212,7 +212,7 @@ class Dialog:
key = self.uniqueKey()
replies = None
if Crossfire.GetPrivateDictionary().has_key(key):
if key in Crossfire.GetPrivateDictionary():
replies = Crossfire.GetPrivateDictionary()[key]
Crossfire.GetPrivateDictionary()[key] = None

View File

@ -103,7 +103,7 @@ index = 0;
for jsonRule in dialogs:
replies = None
if jsonRule.has_key('replies'):
if 'replies' in jsonRule:
replies = jsonRule['replies']
rule = DialogRule(jsonRule["match"],
jsonRule["pre"],