mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 20:41:20 +00:00
ignore unknown stuff
This commit is contained in:
parent
e9f19be2bb
commit
2ccff86089
1 changed files with 23 additions and 20 deletions
|
@ -80,6 +80,7 @@ while 1:
|
|||
else:
|
||||
entity.spawnflags = 0
|
||||
for ent in entity_list:
|
||||
try:
|
||||
if ent.classname[:5] == "item_":
|
||||
item = ent.classname[5:]
|
||||
if item == "weapon":
|
||||
|
@ -100,6 +101,8 @@ for ent in entity_list:
|
|||
elif ent.classname[:7] == "weapon_":
|
||||
weapon = ent.classname[7:]
|
||||
weapons[weapon] += 1
|
||||
except KeyError:
|
||||
pass # ignore unknown items/weapons
|
||||
|
||||
print "Lightning Gun :", weapons["lightning"]
|
||||
print "6 cells :", items["cells"][0]
|
||||
|
|
Loading…
Reference in a new issue