ignore unknown stuff

This commit is contained in:
Bill Currie 2004-05-09 00:57:57 +00:00
parent e9f19be2bb
commit 2ccff86089

View file

@ -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]