Skip to content

Commit

Permalink
fix: some getUserdataShared and transfer house (sell)
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas committed Sep 23, 2023
1 parent 6be36bd commit e6a3655
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/lua/functions/creatures/npc/npc_type_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ int NpcTypeFunctions::luaNpcTypeAddShopItem(lua_State* L) {
return 1;
}

Shop* shop = getUserdata<Shop>(L, 2);
auto shop = getUserdataShared<Shop>(L, 2);
if (shop) {
npcType->loadShop(npcType, shop->shopBlock);
pushBoolean(L, true);
Expand Down
2 changes: 1 addition & 1 deletion src/lua/functions/items/item_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ int ItemFunctions::luaItemIsInsideDepot(lua_State* L) {

int ItemFunctions::luaItemIsContainer(lua_State* L) {
// item:isContainer()
const auto item = getUserdata<const Item>(L, 1);
const auto item = getUserdataShared<const Item>(L, 1);
if (!item) {
reportErrorFunc(getErrorDesc(LUA_ERROR_ITEM_NOT_FOUND));
pushBoolean(L, false);
Expand Down
4 changes: 0 additions & 4 deletions src/map/house/house.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,18 +363,14 @@ std::shared_ptr<HouseTransferItem> House::getTransferItem() {
return nullptr;
}

transfer_container.resetParent();
transferItem = HouseTransferItem::createHouseTransferItem(static_self_cast<House>());
transfer_container.addThing(transferItem);
return transferItem;
}

void House::resetTransferItem() {
if (transferItem) {
std::shared_ptr<Item> tmpItem = transferItem;
transferItem = nullptr;
transfer_container.resetParent();
transfer_container.removeThing(tmpItem, tmpItem->getItemCount());
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/map/house/house.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,6 @@ class House : public SharedObject {
AccessList guestList;
AccessList subOwnerList;

Container transfer_container { ITEM_LOCKER };

HouseTileList houseTiles;
std::list<std::shared_ptr<Door>> doorList;
HouseBedItemList bedsList;
Expand Down

0 comments on commit e6a3655

Please sign in to comment.