diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-10-21 18:51:57 +0200 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-10-21 18:51:57 +0200 |
commit | ea88dde4be225d19c12bea4a581aa21f17237070 (patch) | |
tree | 3787863e03a7222b1c3fde0c37c2d85ae8821326 /src | |
parent | f1ff05bf5932a7825509dbe896e60183a96a6d36 (diff) | |
download | dragonfireclient-ea88dde4be225d19c12bea4a581aa21f17237070.tar.xz |
Added Strip, AutoRefill, indexing for InventoryActions and Wield Index starts at 1 now
Diffstat (limited to 'src')
-rw-r--r-- | src/defaultsettings.cpp | 2 | ||||
-rw-r--r-- | src/script/lua_api/l_inventoryaction.cpp | 2 | ||||
-rw-r--r-- | src/script/lua_api/l_localplayer.cpp | 4 |
3 files changed, 5 insertions, 3 deletions
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 2899f2509..6cc28ac32 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -111,6 +111,8 @@ void set_default_settings(Settings *settings) settings->setDefault("crystal_pvp", "false"); settings->setDefault("autototem", "false"); settings->setDefault("dont_point_nodes", "false"); + settings->setDefault("strip", "false"); + settings->setDefault("autorefill", "false"); // Keymap settings->setDefault("remote_port", "30000"); diff --git a/src/script/lua_api/l_inventoryaction.cpp b/src/script/lua_api/l_inventoryaction.cpp index 516d6d3b2..f3037ba83 100644 --- a/src/script/lua_api/l_inventoryaction.cpp +++ b/src/script/lua_api/l_inventoryaction.cpp @@ -133,7 +133,7 @@ void LuaInventoryAction::readFullInventoryLocationInto(lua_State *L, InventoryLo loc->deSerialize(readParam<std::string>(L, 2)); std::string l = readParam<std::string>(L, 3); *list = l; - *index = luaL_checkinteger(L, 4); + *index = luaL_checkinteger(L, 4) - 1; } catch (SerializationError &) {} } 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); |