diff --git a/CHANGELOG.md b/CHANGELOG.md index 85fffdd1f6..0b559c23f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -207,6 +207,7 @@ Bug #5300: NPCs don't switch from torch to shield when starting combat Bug #5308: World map copying makes save loading much slower Bug #5313: Node properties of identical type are not applied in the correct order + Bug #5345: Dopey Necromancy does not work due to a missing quote Feature #1774: Handle AvoidNode Feature #2229: Improve pathfinding AI Feature #3025: Analogue gamepad movement controls diff --git a/components/compiler/scanner.cpp b/components/compiler/scanner.cpp index b06d683f7e..83686e4c16 100644 --- a/components/compiler/scanner.cpp +++ b/components/compiler/scanner.cpp @@ -368,15 +368,28 @@ namespace Compiler { if (mIgnoreNewline) mErrorHandler.warning ("string contains newline character, make sure that it is intended", mLoc); - else if (name.size() == 1 || (name.size() == 2 && name[1] == '\r')) - { - name.clear(); - mLoc.mLiteral.clear(); - mErrorHandler.warning ("unterminated empty string", mLoc); - break; - } else { + bool allWhitespace = true; + for (size_t i = 1; i < name.size(); i++) + { + //ignore comments + if (name[i] == ';') + break; + else if (name[i] != '\t' && name[i] != ' ' && name[i] != '\r') + { + allWhitespace = false; + break; + } + } + if (allWhitespace) + { + name.clear(); + mLoc.mLiteral.clear(); + mErrorHandler.warning ("unterminated empty string", mLoc); + return true; + } + error = true; mErrorHandler.error ("incomplete string or name", mLoc); break;