misc cleanup
This commit is contained in:
parent
020058b395
commit
9e255408ce
@ -572,7 +572,7 @@ vector<Item*>* BrokerManager::GetItems(
|
||||
"--GetItemsPass: %u (selling: %u), allowinv: %u",
|
||||
itm.unique_id, itm.for_sale, allowInv
|
||||
);
|
||||
ret->push_back(new Item(def, itm.unique_id, itm.creator, pit_player->second.seller_name, cid, itm.cost_copper, itm.count, pit_player->second.house_id));
|
||||
ret->push_back(new Item(def, itm.unique_id, itm.creator, pit_player->second.seller_name, cid, itm.cost_copper, itm.count, pit_player->second.house_id, itm.from_inventory));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
@ -912,6 +912,7 @@ Item::Item(){
|
||||
seller_char_id = 0;
|
||||
seller_house_id = 0;
|
||||
is_search_store_item = false;
|
||||
is_search_in_inventory = false;
|
||||
item_script = "";
|
||||
broker_price = 0;
|
||||
sell_price = 0;
|
||||
@ -948,6 +949,7 @@ Item::Item(Item* in_item){
|
||||
seller_char_id = 0;
|
||||
seller_house_id = 0;
|
||||
is_search_store_item = false;
|
||||
is_search_in_inventory = false;
|
||||
needs_deletion = false;
|
||||
broker_price = 0;
|
||||
sell_price = in_item->sell_price;
|
||||
@ -971,7 +973,7 @@ Item::Item(Item* in_item){
|
||||
details.item_locked = false;
|
||||
}
|
||||
|
||||
Item::Item(Item* in_item, int64 unique_id, std::string in_creator, std::string in_seller_name, int32 in_seller_char_id, int64 in_broker_price, int16 count, int64 in_seller_house_id){
|
||||
Item::Item(Item* in_item, int64 unique_id, std::string in_creator, std::string in_seller_name, int32 in_seller_char_id, int64 in_broker_price, int16 count, int64 in_seller_house_id, bool search_in_inventory){
|
||||
is_search_store_item = true;
|
||||
broker_price = in_broker_price;
|
||||
needs_deletion = false;
|
||||
@ -999,6 +1001,7 @@ Item::Item(Item* in_item, int64 unique_id, std::string in_creator, std::string i
|
||||
seller_house_id = in_seller_house_id;
|
||||
details.lock_flags = 0;
|
||||
details.item_locked = false;
|
||||
is_search_in_inventory = search_in_inventory;
|
||||
}
|
||||
|
||||
Item::~Item(){
|
||||
|
@ -978,7 +978,7 @@ public:
|
||||
#pragma pack()
|
||||
Item();
|
||||
Item(Item* in_item);
|
||||
Item(Item* in_item, int64 unique_id, std::string in_creator, std::string in_seller_name, int32 in_seller_char_id, int64 in_broker_price, int16 count, int64 in_seller_house_id);
|
||||
Item(Item* in_item, int64 unique_id, std::string in_creator, std::string in_seller_name, int32 in_seller_char_id, int64 in_broker_price, int16 count, int64 in_seller_house_id, bool search_in_inventory);
|
||||
|
||||
~Item();
|
||||
string lowername;
|
||||
@ -990,6 +990,7 @@ public:
|
||||
int32 max_sell_value;
|
||||
int64 broker_price;
|
||||
bool is_search_store_item;
|
||||
bool is_search_in_inventory;
|
||||
bool save_needed;
|
||||
int8 weapon_type;
|
||||
string adornment;
|
||||
|
@ -1022,6 +1022,7 @@ void LuaInterface::RemoveSpawnFromSpell(LuaSpell* spell, Spawn* spawn) {
|
||||
((Entity*)spawn)->RemoveSpellBonus(spell);
|
||||
((Entity*)spawn)->RemoveEffectsFromLuaSpell(spell);
|
||||
((Entity*)spawn)->RemoveWard(spell);
|
||||
((Entity*)spawn)->RemoveMaintainedSpell(spell);
|
||||
|
||||
if(spell->spell && spell->spell->GetSpellData() && spell->spell->GetSpellData()->det_type > 0 && (spell->spell->GetSpellDuration() > 0 || spell->spell->GetSpellData()->duration_until_cancel))
|
||||
((Entity*)spawn)->RemoveDetrimentalSpell(spell);
|
||||
|
@ -10620,7 +10620,7 @@ void Client::SearchStore(int32 page) {
|
||||
packet->setArrayDataByName("item_id2", item->details.unique_id, i);
|
||||
packet->setArrayDataByName("sell_price", item->broker_price, i);
|
||||
packet->setArrayDataByName("quantity", item->details.count, i);
|
||||
if(item->seller_house_id) {
|
||||
if(item->seller_house_id && !item->is_search_in_inventory) {
|
||||
HouseZone* hz = world.GetHouseZone(item->seller_house_id);
|
||||
if(hz && item->seller_name.size() > 0) {
|
||||
string name;
|
||||
|
@ -1535,7 +1535,6 @@ void ZoneServer::DeleteSpawns(bool delete_all) {
|
||||
}
|
||||
MPendingSpawnRemoval.releasereadlock(__FUNCTION__, __LINE__);
|
||||
|
||||
MSpawnList.writelock(__FUNCTION__, __LINE__);
|
||||
lua_interface->SetLuaUserDataStale(spawn);
|
||||
|
||||
if (spellProcess) {
|
||||
@ -1553,6 +1552,7 @@ void ZoneServer::DeleteSpawns(bool delete_all) {
|
||||
tmpNPC->SetBrain(nullptr);
|
||||
}
|
||||
|
||||
MSpawnList.writelock(__FUNCTION__, __LINE__);
|
||||
std::map<int32, Spawn*>::iterator sitr = spawn_list.find(spawn->GetID());
|
||||
if(sitr != spawn_list.end()) {
|
||||
spawn_list.erase(sitr);
|
||||
@ -2010,7 +2010,7 @@ bool ZoneServer::SpawnProcess(){
|
||||
|
||||
|
||||
// Delete unused spawns, do this last
|
||||
if(!zoneShuttingDown)
|
||||
if(!zoneShuttingDown && checkRemove)
|
||||
DeleteSpawns(false);
|
||||
|
||||
// Nothing should come after this
|
||||
|
Loading…
x
Reference in New Issue
Block a user