1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Bonus: complex duration as bitset

Fixes #2125
This commit is contained in:
Konstantin P
2023-05-05 12:56:53 +03:00
parent e9a90a8cbf
commit 8764765dcf
9 changed files with 105 additions and 38 deletions

View File

@@ -351,6 +351,14 @@ public:
return 1;
}
template<std::size_t T>
static int quickRetInt(lua_State * L, const std::bitset<T> & value)
{
lua_settop(L, 0);
lua_pushinteger(L, static_cast<int32_t>(value.to_ulong()));
return 1;
}
static int quickRetStr(lua_State * L, const std::string & value)
{
lua_settop(L, 0);