diff options
-rwxr-xr-x | tools/mobdbconverter.py | 4 | ||||
-rw-r--r-- | tools/mobskilldbconverter.py | 2 | ||||
-rw-r--r-- | tools/petdbconverter.py | 2 | ||||
-rw-r--r-- | tools/utils/common.py | 7 |
4 files changed, 7 insertions, 8 deletions
diff --git a/tools/mobdbconverter.py b/tools/mobdbconverter.py index 78047aed9..683e28274 100755 --- a/tools/mobdbconverter.py +++ b/tools/mobdbconverter.py @@ -188,7 +188,7 @@ def convertFile(inFile, itemDb): printField("ChaseRange", fields[21]) printField("Size", fields[22]) printField("Race", fields[23]) - print("\tElement: ({0}, {1})".format(int(fields[24]) % 10, int(fields[24]) / 20)); + print("\tElement: ({0}, {1})".format(int(fields[24]) % 10, int(int(fields[24]) / 20))); mode = int(fields[25], 0) if mode != 0: startGroup("Mode") @@ -260,7 +260,7 @@ def readItemDB(inFile, itemDb): elif line[:3] == "Id:": try: itemId = int(line[4:]) - except: + except ValueError: started = False if itemId != 0 and itemName != "": # was need for remove wrong characters diff --git a/tools/mobskilldbconverter.py b/tools/mobskilldbconverter.py index 310331043..4ba042062 100644 --- a/tools/mobskilldbconverter.py +++ b/tools/mobskilldbconverter.py @@ -206,7 +206,7 @@ def LoadOldDB(mode, serverpath): continue try: Db[MonsterId][skillidx]['val{}'.format(i)] = int(entry[12 + i]) - except: + except ValueError: Db[MonsterId][skillidx]['val{}'.format(i)] = int(entry[12 + i], 16) Db[MonsterId][skillidx]['Emotion'] = entry[17] Db[MonsterId][skillidx]['ChatMsgID'] = entry[18] diff --git a/tools/petdbconverter.py b/tools/petdbconverter.py index 261c1e6ad..1b7d2e4d6 100644 --- a/tools/petdbconverter.py +++ b/tools/petdbconverter.py @@ -175,7 +175,7 @@ def readItemDB(inFile, itemDb): elif line[:3] == "Id:": try: itemId = int(line[4:]) - except: + except ValueError: started = False if itemId != 0 and itemName != "": # was need for remove wrong characters diff --git a/tools/utils/common.py b/tools/utils/common.py index 7b7811654..acceb9b30 100644 --- a/tools/utils/common.py +++ b/tools/utils/common.py @@ -35,13 +35,13 @@ def LoadDBConsts(DBname, mode, serverpath): with io.open(filename) as f: config = libconf.load(f) db = config[DBname] - if DBname is 'item_db': + if DBname == 'item_db': for i, v in enumerate(db): consts[db[i].Id] = db[i].AegisName - elif DBname is 'mob_db': + elif DBname == 'mob_db': for i, v in enumerate(db): consts[db[i].Id] = db[i].SpriteName - elif DBname is 'skill_db': + elif DBname == 'skill_db': for i, v in enumerate(db): consts[db[i].Id] = db[i].Name else: @@ -55,7 +55,6 @@ def LoadDB(DBname, mode, serverpath): if os.path.isfile(serverpath + 'db/{}2.conf'.format(DBname)): filenames.append(serverpath + 'db/{}2.conf'.format(DBname)) - consts = dict() for filename in filenames: with io.open(filename) as f: config = libconf.load(f) |