GOD Wille
Excellent OT User
Where does a housedoor get "refreshed" in sourcecode [tfs 0.4] C++? If you with lua remove a housedoor ingame, and then add a new door, where you then set the new house's doorid to the same as the previous, it is not until you close or open the door once, that the;
1. Description gets set from "You see a door" to "You see a door, owner is X..." .
2. You can use aleta grav, on the door.
How do I refresh it without having to open/close the door?
Door prints 0 before opening/closing it once.
1. Description gets set from "You see a door" to "You see a door, owner is X..." .
2. You can use aleta grav, on the door.
How do I refresh it without having to open/close the door?
Code:
-- house door when server starts, save door id
local door = getItemAttribute(item.uid,"doorid")
-- remove and create a new door because u want to switch out the item id of the housedoor
doRemoveItem(item.uid)
doCreateItem(array.walls.door[i],pos)
-- add house door id to the newly created door
doItemSetAttribute(getThingFromPos(pos).uid,"doorid",door)
Code:
Door* door = house->getDoorByPosition(getNextPosition(player->getDirection(), player->getPosition()));
if(door && house->canEditAccessList(door->getDoorId(), player))
{
std::cout << "Doorid" << door->getDoorId() << std::endl;
player->setEditHouse(house, door->getDoorId());
player->sendHouseWindow(house, door->getDoorId());
g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_WRAPS_BLUE);
}
else
{
std::cout << "Door" << door << std::endl;
player->sendCancelMessage(RET_NOTPOSSIBLE);
g_game.addMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF);
}
return false;
}
Door prints 0 before opening/closing it once.
Last edited: