diff options
author | kaelima <kaelima@live.se> | 2012-02-16 11:11:29 +0100 |
---|---|---|
committer | kaelima <kaelima@live.se> | 2012-02-16 11:11:29 +0100 |
commit | d336c9efc5dfbfa93e8e79e01f55e8abe14820d0 (patch) | |
tree | 331df04a67bac81826d178a96863bdbc44eb6886 | |
parent | 86537a1a52e5d88a33a867322f1dc56d986449c0 (diff) |
Core/Movement: Fix a crash when a player logout in a hostile area. The honorless spell should and is already casted after recieving CMSG_MOVE_SPLINE_DONE.
Closes #5245
- Also corrected an error message in auctionhousemgr.
-rw-r--r-- | src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 40 | ||||
-rwxr-xr-x | src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp | 9 |
2 files changed, 23 insertions, 26 deletions
diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index e7504b4ddd2..a2e958d680f 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -648,37 +648,37 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player } //this function inserts to WorldPacket auction's data -bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const +bool AuctionEntry::BuildAuctionInfo(WorldPacket& data) const { - Item* pItem = sAuctionMgr->GetAItem(item_guidlow); - if (!pItem) + Item* item = sAuctionMgr->GetAItem(item_guidlow); + if (!item) { - sLog->outError("auction to item, that doesn't exist !!!!"); + sLog->outError("AuctionEntry::BuildAuctionInfo: Auction %u has a non-existent item: %u", Id, item_guidlow); return false; } data << uint32(Id); - data << uint32(pItem->GetEntry()); + data << uint32(item->GetEntry()); for (uint8 i = 0; i < MAX_INSPECTED_ENCHANTMENT_SLOT; ++i) { - data << uint32(pItem->GetEnchantmentId(EnchantmentSlot(i))); - data << uint32(pItem->GetEnchantmentDuration(EnchantmentSlot(i))); - data << uint32(pItem->GetEnchantmentCharges(EnchantmentSlot(i))); + data << uint32(item->GetEnchantmentId(EnchantmentSlot(i))); + data << uint32(item->GetEnchantmentDuration(EnchantmentSlot(i))); + data << uint32(item->GetEnchantmentCharges(EnchantmentSlot(i))); } - data << int32(pItem->GetItemRandomPropertyId()); //random item property id - data << uint32(pItem->GetItemSuffixFactor()); //SuffixFactor - data << uint32(pItem->GetCount()); //item->count - data << uint32(pItem->GetSpellCharges()); //item->charge FFFFFFF - data << uint32(0); //Unknown - data << uint64(owner); //Auction->owner - data << uint32(startbid); //Auction->startbid (not sure if useful) + data << int32(item->GetItemRandomPropertyId()); // Random item property id + data << uint32(item->GetItemSuffixFactor()); // SuffixFactor + data << uint32(item->GetCount()); // item->count + data << uint32(item->GetSpellCharges()); // item->charge FFFFFFF + data << uint32(0); // Unknown + data << uint64(owner); // Auction->owner + data << uint32(startbid); // Auction->startbid (not sure if useful) data << uint32(bid ? GetAuctionOutBid() : 0); - //minimal outbid - data << uint32(buyout); //auction->buyout - data << uint32((expire_time-time(NULL))*IN_MILLISECONDS);//time left - data << uint64(bidder); //auction->bidder current - data << uint32(bid); //current bid + // Minimal outbid + data << uint32(buyout); // Auction->buyout + data << uint32((expire_time - time(NULL)) * IN_MILLISECONDS); // time left + data << uint64(bidder); // auction->bidder current + data << uint32(bid); // current bid return true; } diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index 55cf3c28d46..da84325a00a 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -201,20 +201,17 @@ void FlightPathMovementGenerator::Initialize(Player &player) InitEndGridInfo(); } -void FlightPathMovementGenerator::Finalize(Player & player) +void FlightPathMovementGenerator::Finalize(Player& player) { // remove flag to prevent send object build movement packets for flight state and crash (movement generator already not at top of stack) player.ClearUnitState(UNIT_STATE_IN_FLIGHT); player.Dismount(); - player.RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT); + player.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT); - if(player.m_taxi.empty()) + if (player.m_taxi.empty()) { player.getHostileRefManager().setOnlineOfflineState(true); - if(player.pvpInfo.inHostileArea) - player.CastSpell(&player, 2479, true); - // update z position to ground and orientation for landing point // this prevent cheating with landing point at lags // when client side flight end early in comparison server side |