From 79c3462396fd4e1dcb7d1c9a2ef7bad741afa3e3 Mon Sep 17 00:00:00 2001 From: hop311 Date: Fri, 22 Mar 2024 23:28:28 +0000 Subject: GFX objectTypes loading framework + Actor loading --- src/openvic-simulation/types/fixed_point/FixedPoint.hpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/openvic-simulation/types') diff --git a/src/openvic-simulation/types/fixed_point/FixedPoint.hpp b/src/openvic-simulation/types/fixed_point/FixedPoint.hpp index 9ad7966..84d2b70 100644 --- a/src/openvic-simulation/types/fixed_point/FixedPoint.hpp +++ b/src/openvic-simulation/types/fixed_point/FixedPoint.hpp @@ -341,7 +341,7 @@ namespace OpenVic { } // Deterministic - static constexpr fixed_point_t parse(char const* str, char const* const end, bool* successful = nullptr) { + static constexpr fixed_point_t parse(char const* str, char const* end, bool* successful = nullptr) { if (successful != nullptr) { *successful = false; } @@ -360,6 +360,16 @@ namespace OpenVic { } } + { + const char last_char = *(end - 1); + if (last_char == 'f' || last_char == 'F') { + --end; + if (str == end) { + return _0(); + } + } + } + char const* dot_pointer = str; while (*dot_pointer != '.' && ++dot_pointer != end) {} -- cgit v1.2.3-56-ga3b1