From 0bb0c80e51d3f1f393858270053271c5cb7c6e01 Mon Sep 17 00:00:00 2001 From: fed <58637860+fedddddd@users.noreply.github.com> Date: Fri, 14 Oct 2022 20:16:10 +0200 Subject: [PATCH] Mapents fixes --- src/client/component/mapents.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/client/component/mapents.cpp b/src/client/component/mapents.cpp index 693392df..a24ded79 100644 --- a/src/client/component/mapents.cpp +++ b/src/client/component/mapents.cpp @@ -26,10 +26,33 @@ namespace mapents const auto lines = utils::string::split(source, '\n'); auto in_map_ent = false; auto empty = false; + auto in_comment = false; for (auto i = 0; i < lines.size(); i++) { - const auto& line = lines[i]; + auto line = lines[i]; + if (line.ends_with('\r')) + { + line.pop_back(); + } + + if (line.starts_with("/*")) + { + in_comment = true; + continue; + } + + if (line.ends_with("*/")) + { + in_comment = false; + continue; + } + + if (in_comment) + { + continue; + } + if (line.starts_with("//")) { continue;