mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-29 23:52:22 +00:00
Add support for RMQs QUAKED comments.
RMQ just leaves out the entity size instead of using ? for brush entities.
This commit is contained in:
parent
225cb4b364
commit
f18a926616
1 changed files with 12 additions and 4 deletions
|
@ -53,8 +53,12 @@ class EntityClass:
|
|||
script.getToken() # skip over the leading '/*QUAKED'
|
||||
name = script.getToken()
|
||||
color = cls.parse_vector(script)
|
||||
size = cls.parse_size(script)
|
||||
flagnames = cls.parse_flags(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
|
||||
script.ungetToken()
|
||||
return cls.parse_vector(script), cls.parse_vector(script)
|
||||
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 = []
|
||||
|
|
Loading…
Reference in a new issue