mirror of https://github.com/OpenMW/openmw.git
Merge branch 'indexthemoon' into 'master'
Move Lua index helpers to components and make owner.factionRank match other ranks See merge request OpenMW/openmw!4186pull/3236/head
commit
d3c3d0cf44
@ -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…
Reference in New Issue