diff options
author | Elias Fleckenstein <54945686+EliasFleckenstein03@users.noreply.github.com> | 2020-11-04 14:40:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-04 14:40:00 +0100 |
commit | fc8c8f01ca15912b1db176fec473bcfb0333032f (patch) | |
tree | 08182e80b69d5352f81c6827d3caa4efe13e6f14 /src/script/lua_api/l_localplayer.cpp | |
parent | 61e2b3a33190d5979bc2e36f9734cebd18465f26 (diff) | |
parent | a7dc1135e94bde5f8c3385d54388563eaffe7553 (diff) | |
download | dragonfireclient-fc8c8f01ca15912b1db176fec473bcfb0333032f.tar.xz |
Merge branch 'master' into master
Diffstat (limited to 'src/script/lua_api/l_localplayer.cpp')
-rw-r--r-- | src/script/lua_api/l_localplayer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/script/lua_api/l_localplayer.cpp b/src/script/lua_api/l_localplayer.cpp index 8057802a4..e40dd7b37 100644 --- a/src/script/lua_api/l_localplayer.cpp +++ b/src/script/lua_api/l_localplayer.cpp @@ -116,7 +116,7 @@ int LuaLocalPlayer::l_get_wield_index(lua_State *L) { LocalPlayer *player = getobject(L, 1); - lua_pushinteger(L, player->getWieldIndex()); + lua_pushinteger(L, player->getWieldIndex() + 1); return 1; } @@ -124,7 +124,7 @@ int LuaLocalPlayer::l_get_wield_index(lua_State *L) int LuaLocalPlayer::l_set_wield_index(lua_State *L) { LocalPlayer *player = getobject(L, 1); - u32 index = luaL_checkinteger(L, 2); + u32 index = luaL_checkinteger(L, 2) - 1; player->setWieldIndex(index); g_game->processItemSelection(&g_game->runData.new_playeritem); |