mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Move Lua index helpers to components and make owner.factiooRank match other ranks
This commit is contained in:
parent
6653502567
commit
d6fc0744c7
16 changed files with 75 additions and 56 deletions
20
components/lua/util.hpp
Normal file
20
components/lua/util.hpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
#ifndef COMPONENTS_LUA_UTIL_H
|
||||
#define COMPONENTS_LUA_UTIL_H
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace LuaUtil
|
||||
{
|
||||
// Lua arrays index from 1
|
||||
constexpr inline std::int64_t fromLuaIndex(std::int64_t i)
|
||||
{
|
||||
return i - 1;
|
||||
}
|
||||
|
||||
constexpr inline std::int64_t toLuaIndex(std::int64_t i)
|
||||
{
|
||||
return i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue