mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-17 11:28:16 +00:00
Check for references to mask files without .mask extensions.
This commit is contained in:
parent
b202102ee0
commit
cbad5c0d42
@ -1065,6 +1065,15 @@ def translator(filename, mapxforms, textxform):
|
||||
if verbose >= 3:
|
||||
sys.stdout.write(line + terminator)
|
||||
lineno += 1
|
||||
# Check for one certain error condition
|
||||
if "mask" in line and line.count("{") and line.count("}"):
|
||||
maskname = line[line.find("{"):line.rfind("}")]
|
||||
# Ignore all-caps macro arguments.
|
||||
if maskname != maskname.upper() and not maskname.endswith(".mask"):
|
||||
print >>sys.stderr, \
|
||||
'"%s", line %d: fatal error, mask file without .mask extension' \
|
||||
% (filename, lineno+1, line[:line.find("}")])
|
||||
sys.exit(1)
|
||||
# Exclude map_data= lines that are just 1 line without
|
||||
# continuation, or which contain {}. The former are
|
||||
# pathological and the parse won't handle them, the latter
|
||||
|
Loading…
x
Reference in New Issue
Block a user