aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_localplayer.cpp
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2020-10-21 18:51:57 +0200
committerElias Fleckenstein <eliasfleckenstein@web.de>2020-10-21 18:51:57 +0200
commitea88dde4be225d19c12bea4a581aa21f17237070 (patch)
tree3787863e03a7222b1c3fde0c37c2d85ae8821326 /src/script/lua_api/l_localplayer.cpp
parentf1ff05bf5932a7825509dbe896e60183a96a6d36 (diff)
downloaddragonfireclient-ea88dde4be225d19c12bea4a581aa21f17237070.tar.xz
Added Strip, AutoRefill, indexing for InventoryActions and Wield Index starts at 1 now
Diffstat (limited to 'src/script/lua_api/l_localplayer.cpp')
-rw-r--r--src/script/lua_api/l_localplayer.cpp4
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);