diff --git a/src/map_func.h b/src/map_func.h --- a/src/map_func.h +++ b/src/map_func.h @@ -426,7 +426,7 @@ debug_inline static TileIndex TileVirtXY */ debug_inline static uint TileX(TileIndex tile) { - return tile.value & Map::MaxX(); + return static_cast(tile) & Map::MaxX(); } /** @@ -436,7 +436,7 @@ debug_inline static uint TileX(TileIndex */ debug_inline static uint TileY(TileIndex tile) { - return tile.value >> Map::LogX(); + return static_cast(tile) >> Map::LogX(); } /** diff --git a/src/misc/endian_buffer.hpp b/src/misc/endian_buffer.hpp --- a/src/misc/endian_buffer.hpp +++ b/src/misc/endian_buffer.hpp @@ -53,7 +53,7 @@ public: if constexpr (std::is_enum_v) { this->Write(static_cast>(data)); } else if constexpr (std::is_base_of_v) { - this->Write(data.value); + this->Write(static_cast(data)); } else { this->Write(data); } @@ -146,7 +146,7 @@ public: if constexpr (std::is_enum_v) { data = static_cast(this->Read>()); } else if constexpr (std::is_base_of_v) { - data.value = this->Read(); + data = this->Read(); } else { data = this->Read(); } diff --git a/src/script/squirrel_helper.hpp b/src/script/squirrel_helper.hpp --- a/src/script/squirrel_helper.hpp +++ b/src/script/squirrel_helper.hpp @@ -37,7 +37,7 @@ namespace SQConvert { template <> struct Return { static inline int Set(HSQUIRRELVM vm, int32_t res) { sq_pushinteger(vm, res); return 1; } }; template <> struct Return { static inline int Set(HSQUIRRELVM vm, int64_t res) { sq_pushinteger(vm, res); return 1; } }; template <> struct Return { static inline int Set(HSQUIRRELVM vm, Money res) { sq_pushinteger(vm, res); return 1; } }; - template <> struct Return { static inline int Set(HSQUIRRELVM vm, TileIndex res) { sq_pushinteger(vm, (int32_t)res.value); return 1; } }; + template <> struct Return { static inline int Set(HSQUIRRELVM vm, TileIndex res) { sq_pushinteger(vm, (int32_t)static_cast(res)); return 1; } }; template <> struct Return { static inline int Set(HSQUIRRELVM vm, bool res) { sq_pushbool (vm, res); return 1; } }; template <> struct Return { /* Do not use char *, use std::optional instead. */ }; template <> struct Return { /* Do not use const char *, use std::optional instead. */ };