Add support for RMQs QUAKED comments.

RMQ just leaves out the entity size instead of using ? for brush entities.
This commit is contained in:
Bill Currie 2012-09-13 12:21:06 +09:00
parent 225cb4b364
commit f18a926616

View file

@ -53,8 +53,12 @@ class EntityClass:
script.getToken() # skip over the leading '/*QUAKED'
name = script.getToken()
color = cls.parse_vector(script)
if script.tokenAvailable():
size = cls.parse_size(script)
flagnames = cls.parse_flags(script)
else:
size = None
flagnames = ()
comment = cls.extract_comment(script)
return cls(name, color, size, flagnames, comment)
@classmethod
@ -98,8 +102,12 @@ class EntityClass:
def parse_size(cls, script):
if script.getToken() == "?":
return None # use brush size
elif script.token == "(":
script.ungetToken()
return cls.parse_vector(script), cls.parse_vector(script)
else:
script.ungetToken()
return None
@classmethod
def parse_flags(cls, script):
flagnames = []