refactor(vehicles): speedup

Don't check subtypes if we already know it's a creature.
This commit is contained in:
Sabe Jones 2017-01-16 19:23:04 +00:00
parent b5cd4df795
commit a961baf9ed

View file

@ -171,10 +171,10 @@ def fields_check_valid(fields):
for idx, value in fields[field_types]:
if 'creature' in value:
iscreature = True
if fields.get(field_subtypes):
for idx, value in fields[field_subtypes]:
if 'vehicle' in value:
iscreature = True
elif fields.get(field_subtypes):
for idx, value in fields[field_subtypes]:
if 'vehicle' in value:
iscreature = True
if iscreature:
return field_pt in fields
else: