summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/script.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/map/script.cpp b/src/map/script.cpp
index 7ee6306..f3713df 100644
--- a/src/map/script.cpp
+++ b/src/map/script.cpp
@@ -746,10 +746,14 @@ bool read_constdb(ZString filename)
}
bool rv = true;
- AString line;
- while (in.getline(line))
- {
- if (is_comment(line))
+ AString line_;
+ while (in.getline(line_))
+ {
+ // is_comment only works for whole-line comments
+ // that could change once the Z dependency is dropped ...
+ LString comment = "//"_s;
+ XString line = line_.xislice_h(std::search(line_.begin(), line_.end(), comment.begin(), comment.end())).rstrip();
+ if (!line)
continue;
// "%m[A-Za-z0-9_] %i %i"
@@ -780,7 +784,7 @@ bool read_constdb(ZString filename)
|| !extract(val_, &val)
|| (!extract(type_, &type) && type_))
{
- PRINTF("Bad const line: %s\n"_fmt, line);
+ PRINTF("Bad const line: %s\n"_fmt, line_);
rv = false;
continue;
}