aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/collision/BoundingIntervalHierarchy.cpp2
-rw-r--r--src/server/collision/Management/MMapManager.cpp2
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp2
-rw-r--r--src/server/game/Battlegrounds/ArenaTeam.cpp38
-rw-r--r--src/server/game/Conditions/ConditionMgr.cpp12
-rw-r--r--src/server/game/DataStores/DBCStores.cpp9
-rw-r--r--src/server/game/Entities/Player/Player.cpp3
-rwxr-xr-xsrc/server/game/Entities/Vehicle/Vehicle.cpp3
-rw-r--r--src/server/game/Guilds/Guild.cpp4
-rw-r--r--src/server/game/Handlers/AuctionHouseHandler.cpp225
-rw-r--r--src/server/game/Handlers/CalendarHandler.cpp4
-rw-r--r--src/server/game/Handlers/MiscHandler.cpp2
-rw-r--r--src/server/game/Handlers/TicketHandler.cpp1
-rw-r--r--src/server/game/Loot/LootMgr.cpp12
-rw-r--r--src/server/game/Maps/Map.cpp6
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp2
-rw-r--r--src/server/game/Spells/SpellEffects.cpp2
-rw-r--r--src/server/scripts/Commands/cs_rbac.cpp42
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp170
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp2
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp3
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp11
-rw-r--r--src/server/shared/Cryptography/SHA1.cpp1
-rw-r--r--src/server/shared/Database/Field.cpp1
-rw-r--r--src/server/shared/Database/MySQLConnection.cpp2
-rw-r--r--src/server/shared/Database/PreparedStatement.cpp1
-rw-r--r--src/server/shared/Threading/Callback.h2
-rw-r--r--src/server/worldserver/TCSoap/TCSoap.h2
28 files changed, 298 insertions, 268 deletions
diff --git a/src/server/collision/BoundingIntervalHierarchy.cpp b/src/server/collision/BoundingIntervalHierarchy.cpp
index 340d66ddaf0..c5ae1f2a265 100644
--- a/src/server/collision/BoundingIntervalHierarchy.cpp
+++ b/src/server/collision/BoundingIntervalHierarchy.cpp
@@ -272,7 +272,7 @@ bool BIH::readFromFile(FILE* rf)
check += fread(&count, sizeof(uint32), 1, rf);
objects.resize(count); // = new uint32[nObjects];
check += fread(&objects[0], sizeof(uint32), count, rf);
- return check == (3 + 3 + 2 + treeSize + count);
+ return uint64(check) == uint64(3 + 3 + 1 + 1 + uint64(treeSize) + uint64(count));
}
void BIH::BuildStats::updateLeaf(int depth, int n)
diff --git a/src/server/collision/Management/MMapManager.cpp b/src/server/collision/Management/MMapManager.cpp
index 70ae878aa6b..ac0a935dd39 100644
--- a/src/server/collision/Management/MMapManager.cpp
+++ b/src/server/collision/Management/MMapManager.cpp
@@ -123,6 +123,7 @@ namespace MMAP
if (fread(&fileHeader, sizeof(MmapTileHeader), 1, file) != 1 || fileHeader.mmapMagic != MMAP_MAGIC)
{
TC_LOG_ERROR(LOG_FILTER_MAPS, "MMAP:loadMap: Bad header in mmap %03u%02i%02i.mmtile", mapId, x, y);
+ fclose(file);
return false;
}
@@ -130,6 +131,7 @@ namespace MMAP
{
TC_LOG_ERROR(LOG_FILTER_MAPS, "MMAP:loadMap: %03u%02i%02i.mmtile was built with generator v%i, expected v%i",
mapId, x, y, fileHeader.mmapVersion, MMAP_VERSION);
+ fclose(file);
return false;
}
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index b4053da2932..b0b72b8c44a 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -1470,8 +1470,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (!einfo)
{
TC_LOG_ERROR(LOG_FILTER_SQL, "SmartScript: SMART_ACTION_EQUIP uses non-existent equipment info id %u for creature %u", equipId, npc->GetEntry());
+ delete targets;
return;
}
+
npc->SetCurrentEquipmentId(equipId);
slot[0] = einfo->ItemEntry[0];
slot[1] = einfo->ItemEntry[1];
diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp
index 8ceeed90d92..af76ff71223 100644
--- a/src/server/game/Battlegrounds/ArenaTeam.cpp
+++ b/src/server/game/Battlegrounds/ArenaTeam.cpp
@@ -367,31 +367,31 @@ void ArenaTeam::Roster(WorldSession* session)
uint8 unk308 = 0;
WorldPacket data(SMSG_ARENA_TEAM_ROSTER, 100);
- data << uint32(GetId()); // team id
- data << uint8(unk308); // 308 unknown value but affect packet structure
- data << uint32(GetMembersSize()); // members count
- data << uint32(GetType()); // arena team type?
+ data << uint32(GetId()); // team id
+ data << uint8(unk308); // 3.0.8 unknown value but affect packet structure
+ data << uint32(GetMembersSize()); // members count
+ data << uint32(GetType()); // arena team type?
for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr)
{
player = ObjectAccessor::FindPlayer(itr->Guid);
- data << uint64(itr->Guid); // guid
+ data << uint64(itr->Guid); // guid
data << uint8((player ? 1 : 0)); // online flag
- data << itr->Name; // member name
- data << uint32((itr->Guid == GetCaptain() ? 0 : 1));// captain flag 0 captain 1 member
- data << uint8((player ? player->getLevel() : 0)); // unknown, level?
- data << uint8(itr->Class); // class
- data << uint32(itr->WeekGames); // played this week
- data << uint32(itr->WeekWins); // wins this week
- data << uint32(itr->SeasonGames); // played this season
- data << uint32(itr->SeasonWins); // wins this season
- data << uint32(itr->PersonalRating); // personal rating
- if (unk308)
- {
- data << float(0.0f); // 308 unk
- data << float(0.0f); // 308 unk
- }
+ data << itr->Name; // member name
+ data << uint32((itr->Guid == GetCaptain() ? 0 : 1)); // captain flag 0 captain 1 member
+ data << uint8((player ? player->getLevel() : 0)); // unknown, level?
+ data << uint8(itr->Class); // class
+ data << uint32(itr->WeekGames); // played this week
+ data << uint32(itr->WeekWins); // wins this week
+ data << uint32(itr->SeasonGames); // played this season
+ data << uint32(itr->SeasonWins); // wins this season
+ data << uint32(itr->PersonalRating); // personal rating
+ //if (unk308)
+ //{
+ // data << float(0.0f); // 308 unk
+ // data << float(0.0f); // 308 unk
+ //}
}
session->SendPacket(&data);
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp
index 9b1cfed7038..67c81b35065 100644
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -1110,6 +1110,9 @@ bool ConditionMgr::addToSpellImplicitTargetConditions(Condition* cond)
if ((1<<firstEffIndex) & *itr)
break;
+ if (firstEffIndex >= MAX_SPELL_EFFECTS)
+ return false;
+
// get shared data
ConditionList* sharedList = spellInfo->Effects[firstEffIndex].ImplicitTargetConditions;
@@ -1129,9 +1132,18 @@ bool ConditionMgr::addToSpellImplicitTargetConditions(Condition* cond)
{
// add new list, create new shared mask
sharedList = new ConditionList();
+ bool assigned = false;
for (uint8 i = firstEffIndex; i < MAX_SPELL_EFFECTS; ++i)
+ {
if ((1<<i) & commonMask)
+ {
spellInfo->Effects[i].ImplicitTargetConditions = sharedList;
+ assigned = true;
+ }
+ }
+
+ if (!assigned)
+ delete sharedList;
}
sharedList->push_back(cond);
break;
diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp
index e7ab55599d8..71fbf1c62b2 100644
--- a/src/server/game/DataStores/DBCStores.cpp
+++ b/src/server/game/DataStores/DBCStores.cpp
@@ -508,10 +508,9 @@ void LoadDBCStores(const std::string& dataPath)
continue;
// store class talent tab pages
- uint32 cls = 1;
- for (uint32 m=1; !(m & talentTabInfo->ClassMask) && cls < MAX_CLASSES; m <<= 1, ++cls) {}
-
- sTalentTabPages[cls][talentTabInfo->tabpage]=talentTabId;
+ for (uint32 cls = 1; cls < MAX_CLASSES; ++cls)
+ if (talentTabInfo->ClassMask & (1 << (cls - 1)))
+ sTalentTabPages[cls][talentTabInfo->tabpage] = talentTabId;
}
}
@@ -914,7 +913,7 @@ LFGDungeonEntry const* GetLFGDungeon(uint32 mapId, Difficulty difficulty)
if (!dungeon)
continue;
- if (dungeon->map == (int)mapId && Difficulty(dungeon->difficulty) == difficulty)
+ if (dungeon->map == int32(mapId) && Difficulty(dungeon->difficulty) == difficulty)
return dungeon;
}
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 353ba8f7f7c..83118e6ded7 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -2549,8 +2549,9 @@ void Player::Regenerate(Powers power)
case POWER_RUNE:
case POWER_FOCUS:
case POWER_HAPPINESS:
- case POWER_HEALTH:
break;
+ case POWER_HEALTH:
+ return;
default:
break;
}
diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp
index d8965218980..fd5183753e1 100755
--- a/src/server/game/Entities/Vehicle/Vehicle.cpp
+++ b/src/server/game/Entities/Vehicle/Vehicle.cpp
@@ -353,8 +353,9 @@ SeatMap::const_iterator Vehicle::GetNextEmptySeat(int8 seatId, bool next) const
}
else
{
- if (seat-- == Seats.begin())
+ if (seat == Seats.begin())
seat = Seats.end();
+ --seat;
}
// Make sure we don't loop indefinetly
diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp
index 6f118126b3b..0369615da53 100644
--- a/src/server/game/Guilds/Guild.cpp
+++ b/src/server/game/Guilds/Guild.cpp
@@ -2571,7 +2571,7 @@ inline int32 Guild::_GetMemberRemainingSlots(Member const* member, uint8 tabId)
uint8 rankId = member->GetRankId();
if (rankId == GR_GUILDMASTER)
return GUILD_WITHDRAW_SLOT_UNLIMITED;
- if ((_GetRankBankTabRights(rankId, tabId) & GUILD_BANK_RIGHT_VIEW_TAB) != GR_RIGHT_EMPTY)
+ if ((_GetRankBankTabRights(rankId, tabId) & GUILD_BANK_RIGHT_VIEW_TAB) != 0)
{
int32 remaining = _GetRankBankTabSlotsPerDay(rankId, tabId) - member->GetBankWithdrawValue(tabId);
if (remaining > 0)
@@ -2589,7 +2589,7 @@ inline int32 Guild::_GetMemberRemainingMoney(Member const* member) const
if (rankId == GR_GUILDMASTER)
return GUILD_WITHDRAW_MONEY_UNLIMITED;
- if ((_GetRankRights(rankId) & (GR_RIGHT_WITHDRAW_REPAIR | GR_RIGHT_WITHDRAW_GOLD)) != GR_RIGHT_EMPTY)
+ if ((_GetRankRights(rankId) & (GR_RIGHT_WITHDRAW_REPAIR | GR_RIGHT_WITHDRAW_GOLD)) != 0)
{
int32 remaining = _GetRankBankMoneyPerDay(rankId) - member->GetBankWithdrawValue(GUILD_BANK_MAX_TABS);
if (remaining > 0)
diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp
index cd914951ae8..6f44b867c4b 100644
--- a/src/server/game/Handlers/AuctionHouseHandler.cpp
+++ b/src/server/game/Handlers/AuctionHouseHandler.cpp
@@ -230,140 +230,137 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData)
}
}
- for (uint32 i = 0; i < itemsCount; ++i)
+ Item* item = items[0];
+
+ uint32 auctionTime = uint32(etime * sWorld->getRate(RATE_AUCTION_TIME));
+ AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
+
+ uint32 deposit = sAuctionMgr->GetAuctionDeposit(auctionHouseEntry, etime, item, finalCount);
+ if (!_player->HasEnoughMoney(deposit))
{
- Item* item = items[i];
+ SendAuctionCommandResult(0, AUCTION_SELL_ITEM, ERR_AUCTION_NOT_ENOUGHT_MONEY);
+ return;
+ }
- uint32 auctionTime = uint32(etime * sWorld->getRate(RATE_AUCTION_TIME));
- AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction());
+ AuctionEntry* AH = new AuctionEntry();
+
+ if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION))
+ AH->auctioneer = 23442; ///@TODO - HARDCODED DB GUID, BAD BAD BAD
+ else
+ AH->auctioneer = GUID_LOPART(auctioneer);
- uint32 deposit = sAuctionMgr->GetAuctionDeposit(auctionHouseEntry, etime, item, finalCount);
- if (!_player->HasEnoughMoney(deposit))
+ // Required stack size of auction matches to current item stack size, just move item to auctionhouse
+ if (itemsCount == 1 && item->GetCount() == count[0])
+ {
+ if (HasPermission(RBAC_PERM_LOG_GM_TRADE))
{
- SendAuctionCommandResult(0, AUCTION_SELL_ITEM, ERR_AUCTION_NOT_ENOUGHT_MONEY);
- return;
+ sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)",
+ GetPlayerName().c_str(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount());
}
- _player->ModifyMoney(-int32(deposit));
-
- AuctionEntry* AH = new AuctionEntry;
AH->Id = sObjectMgr->GenerateAuctionID();
-
- if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION))
- AH->auctioneer = 23442;
- else
- AH->auctioneer = GUID_LOPART(auctioneer);
-
- // Required stack size of auction matches to current item stack size, just move item to auctionhouse
- if (itemsCount == 1 && item->GetCount() == count[i])
+ AH->itemGUIDLow = item->GetGUIDLow();
+ AH->itemEntry = item->GetEntry();
+ AH->itemCount = item->GetCount();
+ AH->owner = _player->GetGUIDLow();
+ AH->startbid = bid;
+ AH->bidder = 0;
+ AH->bid = 0;
+ AH->buyout = buyout;
+ AH->expire_time = time(NULL) + auctionTime;
+ AH->deposit = deposit;
+ AH->auctionHouseEntry = auctionHouseEntry;
+
+ TC_LOG_INFO(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName().c_str(), _player->GetGUIDLow(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetGUIDLow(), AH->auctioneer, item->GetCount(), bid, buyout, auctionTime, AH->GetHouseId());
+ sAuctionMgr->AddAItem(item);
+ auctionHouse->AddAuction(AH);
+
+ _player->MoveItemFromInventory(item->GetBagSlot(), item->GetSlot(), true);
+
+ SQLTransaction trans = CharacterDatabase.BeginTransaction();
+ item->DeleteFromInventoryDB(trans);
+ item->SaveToDB(trans);
+ AH->SaveToDB(trans);
+ _player->SaveInventoryAndGoldToDB(trans);
+ CharacterDatabase.CommitTransaction(trans);
+
+ SendAuctionCommandResult(AH->Id, AUCTION_SELL_ITEM, ERR_AUCTION_OK);
+
+ GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1);
+ }
+ else // Required stack size of auction does not match to current item stack size, clone item and set correct stack size
+ {
+ Item* newItem = item->CloneItem(finalCount, _player);
+ if (!newItem)
{
- if (HasPermission(RBAC_PERM_LOG_GM_TRADE))
- {
- sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)",
- GetPlayerName().c_str(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount());
- }
-
- AH->itemGUIDLow = item->GetGUIDLow();
- AH->itemEntry = item->GetEntry();
- AH->itemCount = item->GetCount();
- AH->owner = _player->GetGUIDLow();
- AH->startbid = bid;
- AH->bidder = 0;
- AH->bid = 0;
- AH->buyout = buyout;
- AH->expire_time = time(NULL) + auctionTime;
- AH->deposit = deposit;
- AH->auctionHouseEntry = auctionHouseEntry;
-
- TC_LOG_INFO(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName().c_str(), _player->GetGUIDLow(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetGUIDLow(), AH->auctioneer, item->GetCount(), bid, buyout, auctionTime, AH->GetHouseId());
- sAuctionMgr->AddAItem(item);
- auctionHouse->AddAuction(AH);
-
- _player->MoveItemFromInventory(item->GetBagSlot(), item->GetSlot(), true);
-
- SQLTransaction trans = CharacterDatabase.BeginTransaction();
- item->DeleteFromInventoryDB(trans);
- item->SaveToDB(trans);
- AH->SaveToDB(trans);
- _player->SaveInventoryAndGoldToDB(trans);
- CharacterDatabase.CommitTransaction(trans);
-
- SendAuctionCommandResult(AH->Id, AUCTION_SELL_ITEM, ERR_AUCTION_OK);
-
- GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1);
+ TC_LOG_ERROR(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Could not create clone of item %u", item->GetEntry());
+ SendAuctionCommandResult(0, AUCTION_SELL_ITEM, ERR_AUCTION_DATABASE_ERROR);
+ delete AH;
return;
}
- else // Required stack size of auction does not match to current item stack size, clone item and set correct stack size
+
+ if (HasPermission(RBAC_PERM_LOG_GM_TRADE))
{
- Item* newItem = item->CloneItem(finalCount, _player);
- if (!newItem)
- {
- TC_LOG_ERROR(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Could not create clone of item %u", item->GetEntry());
- SendAuctionCommandResult(0, AUCTION_SELL_ITEM, ERR_AUCTION_DATABASE_ERROR);
- return;
- }
+ sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)",
+ GetPlayerName().c_str(), GetAccountId(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetCount());
+ }
- if (HasPermission(RBAC_PERM_LOG_GM_TRADE))
+ AH->Id = sObjectMgr->GenerateAuctionID();
+ AH->itemGUIDLow = newItem->GetGUIDLow();
+ AH->itemEntry = newItem->GetEntry();
+ AH->itemCount = newItem->GetCount();
+ AH->owner = _player->GetGUIDLow();
+ AH->startbid = bid;
+ AH->bidder = 0;
+ AH->bid = 0;
+ AH->buyout = buyout;
+ AH->expire_time = time(NULL) + auctionTime;
+ AH->deposit = deposit;
+ AH->auctionHouseEntry = auctionHouseEntry;
+
+ TC_LOG_INFO(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName().c_str(), _player->GetGUIDLow(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetGUIDLow(), AH->auctioneer, newItem->GetCount(), bid, buyout, auctionTime, AH->GetHouseId());
+ sAuctionMgr->AddAItem(newItem);
+ auctionHouse->AddAuction(AH);
+
+ for (uint32 j = 0; j < itemsCount; ++j)
+ {
+ Item* item2 = items[j];
+
+ // Item stack count equals required count, ready to delete item - cloned item will be used for auction
+ if (item2->GetCount() == count[j])
{
- sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)",
- GetPlayerName().c_str(), GetAccountId(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetCount());
- }
+ _player->MoveItemFromInventory(item2->GetBagSlot(), item2->GetSlot(), true);
- AH->itemGUIDLow = newItem->GetGUIDLow();
- AH->itemEntry = newItem->GetEntry();
- AH->itemCount = newItem->GetCount();
- AH->owner = _player->GetGUIDLow();
- AH->startbid = bid;
- AH->bidder = 0;
- AH->bid = 0;
- AH->buyout = buyout;
- AH->expire_time = time(NULL) + auctionTime;
- AH->deposit = deposit;
- AH->auctionHouseEntry = auctionHouseEntry;
-
- TC_LOG_INFO(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName().c_str(), _player->GetGUIDLow(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetGUIDLow(), AH->auctioneer, newItem->GetCount(), bid, buyout, auctionTime, AH->GetHouseId());
- sAuctionMgr->AddAItem(newItem);
- auctionHouse->AddAuction(AH);
-
- for (uint32 j = 0; j < itemsCount; ++j)
+ SQLTransaction trans = CharacterDatabase.BeginTransaction();
+ item2->DeleteFromInventoryDB(trans);
+ item2->DeleteFromDB(trans);
+ CharacterDatabase.CommitTransaction(trans);
+ }
+ else // Item stack count is bigger than required count, update item stack count and save to database - cloned item will be used for auction
{
- Item* item2 = items[j];
-
- // Item stack count equals required count, ready to delete item - cloned item will be used for auction
- if (item2->GetCount() == count[j])
- {
- _player->MoveItemFromInventory(item2->GetBagSlot(), item2->GetSlot(), true);
-
- SQLTransaction trans = CharacterDatabase.BeginTransaction();
- item2->DeleteFromInventoryDB(trans);
- item2->DeleteFromDB(trans);
- CharacterDatabase.CommitTransaction(trans);
- }
- else // Item stack count is bigger than required count, update item stack count and save to database - cloned item will be used for auction
- {
- item2->SetCount(item2->GetCount() - count[j]);
- item2->SetState(ITEM_CHANGED, _player);
- _player->ItemRemovedQuestCheck(item2->GetEntry(), count[j]);
- item2->SendUpdateToPlayer(_player);
-
- SQLTransaction trans = CharacterDatabase.BeginTransaction();
- item2->SaveToDB(trans);
- CharacterDatabase.CommitTransaction(trans);
- }
+ item2->SetCount(item2->GetCount() - count[j]);
+ item2->SetState(ITEM_CHANGED, _player);
+ _player->ItemRemovedQuestCheck(item2->GetEntry(), count[j]);
+ item2->SendUpdateToPlayer(_player);
+
+ SQLTransaction trans = CharacterDatabase.BeginTransaction();
+ item2->SaveToDB(trans);
+ CharacterDatabase.CommitTransaction(trans);
}
+ }
- SQLTransaction trans = CharacterDatabase.BeginTransaction();
- newItem->SaveToDB(trans);
- AH->SaveToDB(trans);
- _player->SaveInventoryAndGoldToDB(trans);
- CharacterDatabase.CommitTransaction(trans);
+ SQLTransaction trans = CharacterDatabase.BeginTransaction();
+ newItem->SaveToDB(trans);
+ AH->SaveToDB(trans);
+ _player->SaveInventoryAndGoldToDB(trans);
+ CharacterDatabase.CommitTransaction(trans);
- SendAuctionCommandResult(AH->Id, AUCTION_SELL_ITEM, ERR_AUCTION_OK);
+ SendAuctionCommandResult(AH->Id, AUCTION_SELL_ITEM, ERR_AUCTION_OK);
- GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1);
- return;
- }
+ GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1);
}
+
+ _player->ModifyMoney(-int32(deposit));
}
//this function is called when client bids or buys out auction
diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp
index d0c8d3e3f1f..b47e085ab6c 100644
--- a/src/server/game/Handlers/CalendarHandler.cpp
+++ b/src/server/game/Handlers/CalendarHandler.cpp
@@ -446,8 +446,8 @@ void WorldSession::HandleCalendarEventInvite(WorldPacket& recvData)
}
// 946684800 is 01/01/2000 00:00:00 - default response time
- CalendarInvite* invite = new CalendarInvite(inviteId, 0, inviteeGuid, playerGuid, 946684800, CALENDAR_STATUS_INVITED, CALENDAR_RANK_PLAYER, "");
- sCalendarMgr->SendCalendarEventInvite(*invite);
+ CalendarInvite invite(inviteId, 0, inviteeGuid, playerGuid, 946684800, CALENDAR_STATUS_INVITED, CALENDAR_RANK_PLAYER, "");
+ sCalendarMgr->SendCalendarEventInvite(invite);
}
}
diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp
index a17b455506a..088a13cd7c6 100644
--- a/src/server/game/Handlers/MiscHandler.cpp
+++ b/src/server/game/Handlers/MiscHandler.cpp
@@ -999,7 +999,7 @@ void WorldSession::HandleRequestAccountData(WorldPacket& recvData)
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "RAD: type %u", type);
- if (type > NUM_ACCOUNT_DATA_TYPES)
+ if (type >= NUM_ACCOUNT_DATA_TYPES)
return;
AccountData* adata = GetAccountData(AccountDataType(type));
diff --git a/src/server/game/Handlers/TicketHandler.cpp b/src/server/game/Handlers/TicketHandler.cpp
index d39099485a5..57d41be9e23 100644
--- a/src/server/game/Handlers/TicketHandler.cpp
+++ b/src/server/game/Handlers/TicketHandler.cpp
@@ -83,6 +83,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket& recvData)
{
TC_LOG_ERROR(LOG_FILTER_NETWORKIO, "CMSG_GMTICKET_CREATE possibly corrupt. Uncompression failed.");
recvData.rfinish();
+ delete ticket;
return;
}
diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp
index 92b6ddf6909..5765d64ce60 100644
--- a/src/server/game/Loot/LootMgr.cpp
+++ b/src/server/game/Loot/LootMgr.cpp
@@ -158,6 +158,12 @@ uint32 LootStore::LoadLootTable()
continue; // error already printed to log/console.
}
+ if (group >= 1 << 7) // it stored in 7 bit field
+ {
+ TC_LOG_ERROR(LOG_FILTER_SQL, "Table '%s' entry %d item %d: group (%u) must be less %u - skipped", GetName(), entry, item, group, 1 << 7);
+ return false;
+ }
+
LootStoreItem* storeitem = new LootStoreItem(item, chanceOrQuestChance, lootmode, group, mincountOrRef, maxcount);
if (!storeitem->IsValid(*this, entry)) // Validity checks
@@ -293,12 +299,6 @@ bool LootStoreItem::Roll(bool rate) const
// Checks correctness of values
bool LootStoreItem::IsValid(LootStore const& store, uint32 entry) const
{
- if (group >= 1 << 7) // it stored in 7 bit field
- {
- TC_LOG_ERROR(LOG_FILTER_SQL, "Table '%s' entry %d item %d: group (%u) must be less %u - skipped", store.GetName(), entry, itemid, group, 1 << 7);
- return false;
- }
-
if (mincountOrRef == 0)
{
TC_LOG_ERROR(LOG_FILTER_SQL, "Table '%s' entry %d item %d: wrong mincountOrRef (%d) - skipped", store.GetName(), entry, itemid, mincountOrRef);
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index b28873d2e4d..d59f475f300 100644
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -672,6 +672,8 @@ void Map::ProcessRelocationNotifies(const uint32 diff)
void Map::RemovePlayerFromMap(Player* player, bool remove)
{
+ sScriptMgr->OnPlayerLeaveMap(this, player);
+
player->RemoveFromWorld();
SendRemoveTransports(player);
@@ -682,11 +684,7 @@ void Map::RemovePlayerFromMap(Player* player, bool remove)
ASSERT(remove); //maybe deleted in logoutplayer when player is not in a map
if (remove)
- {
DeleteFromWorld(player);
-
- sScriptMgr->OnPlayerLeaveMap(this, player);
- }
}
template<class T>
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 09da8885076..53c5da30936 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -588,7 +588,7 @@ void AuraEffect::CalculateSpellMod()
m_spellmod->op = SpellModOp(GetMiscValue());
ASSERT(m_spellmod->op < MAX_SPELLMOD);
- m_spellmod->type = SpellModType(GetAuraType()); // SpellModType value == spell aura types
+ m_spellmod->type = SpellModType(uint32(GetAuraType())); // SpellModType value == spell aura types
m_spellmod->spellId = GetId();
m_spellmod->mask = GetSpellInfo()->Effects[GetEffIndex()].SpellClassMask;
m_spellmod->charges = GetBase()->GetCharges();
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index e96156d85b5..db6263a8062 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -5695,7 +5695,7 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex)
if ((player->GetRuneCooldown(l) && player->GetCurrentRune(l) == RuneType(m_spellInfo->Effects[effIndex].MiscValueB)) && (player->GetRuneCooldown(l+1) && player->GetCurrentRune(l+1) == RuneType(m_spellInfo->Effects[effIndex].MiscValueB)))
{
// Should always update the rune with the lowest cd
- if (player->GetRuneCooldown(l) >= player->GetRuneCooldown(l+1))
+ if (l + 1 < MAX_RUNES && player->GetRuneCooldown(l) >= player->GetRuneCooldown(l+1))
l++;
player->SetRuneCooldown(l, 0);
--count;
diff --git a/src/server/scripts/Commands/cs_rbac.cpp b/src/server/scripts/Commands/cs_rbac.cpp
index 604218c2e68..667815ce16c 100644
--- a/src/server/scripts/Commands/cs_rbac.cpp
+++ b/src/server/scripts/Commands/cs_rbac.cpp
@@ -32,6 +32,12 @@ EndScriptData */
struct RBACCommandData
{
RBACCommandData(): id(0), realmId(0), rbac(NULL), needDelete(false) { }
+ ~RBACCommandData()
+ {
+ if (needDelete)
+ delete rbac;
+ }
+
uint32 id;
int32 realmId;
RBACData* rbac;
@@ -230,8 +236,7 @@ public:
break;
}
- if (command->needDelete)
- delete command;
+ delete command;
return true;
}
@@ -266,8 +271,7 @@ public:
break;
}
- if (command->needDelete)
- delete command;
+ delete command;
return true;
}
@@ -295,8 +299,7 @@ public:
}
}
- if (command->needDelete)
- delete command;
+ delete command;
return true;
}
@@ -335,8 +338,7 @@ public:
break;
}
- if (command->needDelete)
- delete command;
+ delete command;
return true;
}
@@ -375,8 +377,7 @@ public:
break;
}
- if (command->needDelete)
- delete command;
+ delete command;
return true;
}
@@ -411,8 +412,7 @@ public:
break;
}
- if (command->needDelete)
- delete command;
+ delete command;
return true;
}
@@ -453,8 +453,7 @@ public:
}
}
- if (command->needDelete)
- delete command;
+ delete command;
return true;
}
@@ -493,8 +492,7 @@ public:
break;
}
- if (command->needDelete)
- delete command;
+ delete command;
return true;
}
@@ -533,8 +531,7 @@ public:
break;
}
- if (command->needDelete)
- delete command;
+ delete command;
return true;
}
@@ -569,8 +566,7 @@ public:
break;
}
- if (command->needDelete)
- delete command;
+ delete command;
return true;
}
@@ -613,8 +609,7 @@ public:
}
}
- if (command->needDelete)
- delete command;
+ delete command;
return true;
}
@@ -643,8 +638,7 @@ public:
}
}
- if (command->needDelete)
- delete command;
+ delete command;
return true;
}
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp
index 1f8ba3edade..71ef0cbe3ce 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp
@@ -110,103 +110,107 @@ class npc_verdisa_beglaristrasz_eternos : public CreatureScript
public:
npc_verdisa_beglaristrasz_eternos() : CreatureScript("npc_verdisa_beglaristrasz_eternos") { }
- InstanceScript* instance;
-
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
{
player->PlayerTalkClass->ClearMenus();
switch (creature->GetEntry())
{
- case NPC_VERDISA: //Verdisa
- switch (action)
+ case NPC_VERDISA: //Verdisa
{
- case GOSSIP_ACTION_INFO_DEF + 1:
- if (!HAS_ESSENCE(player))
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VERDISA1, creature->GetGUID());
- }
- else
+ switch (action)
{
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VERDISA2, creature->GetGUID());
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ if (!HAS_ESSENCE(player))
+ {
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VERDISA1, creature->GetGUID());
+ }
+ else
+ {
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VERDISA2, creature->GetGUID());
+ }
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ {
+ ItemPosCountVec dest;
+ uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_EMERALD_ESSENCE, 1);
+ if (msg == EQUIP_ERR_OK)
+ player->StoreNewItem(dest, ITEM_EMERALD_ESSENCE, true);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ }
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VERDISA3, creature->GetGUID());
+ break;
}
break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- {
- ItemPosCountVec dest;
- uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_EMERALD_ESSENCE, 1);
- if (msg == EQUIP_ERR_OK)
- player->StoreNewItem(dest, ITEM_EMERALD_ESSENCE, true);
- player->CLOSE_GOSSIP_MENU();
- break;
}
- case GOSSIP_ACTION_INFO_DEF + 3:
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VERDISA3, creature->GetGUID());
- break;
- }
- break;
- case NPC_BELGARISTRASZ: //Belgaristrasz
- switch (action)
+ case NPC_BELGARISTRASZ: //Belgaristrasz
{
- case GOSSIP_ACTION_INFO_DEF + 1:
- if (!HAS_ESSENCE(player))
+ switch (action)
{
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_BELGARISTRASZ1, creature->GetGUID());
- }
- else
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_BELGARISTRASZ2, creature->GetGUID());
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ if (!HAS_ESSENCE(player))
+ {
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_BELGARISTRASZ1, creature->GetGUID());
+ }
+ else
+ {
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_BELGARISTRASZ2, creature->GetGUID());
+ }
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ {
+ ItemPosCountVec dest;
+ uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_RUBY_ESSENCE, 1);
+ if (msg == EQUIP_ERR_OK)
+ player->StoreNewItem(dest, ITEM_RUBY_ESSENCE, true);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ }
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_BELGARISTRASZ3, creature->GetGUID());
+ break;
}
break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- {
- ItemPosCountVec dest;
- uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_RUBY_ESSENCE, 1);
- if (msg == EQUIP_ERR_OK)
- player->StoreNewItem(dest, ITEM_RUBY_ESSENCE, true);
- player->CLOSE_GOSSIP_MENU();
- break;
- }
- case GOSSIP_ACTION_INFO_DEF + 3:
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_BELGARISTRASZ3, creature->GetGUID());
- break;
}
- break;
- case NPC_ETERNOS: //Eternos
- switch (action)
+ case NPC_ETERNOS: //Eternos
{
- case GOSSIP_ACTION_INFO_DEF + 1:
- if (!HAS_ESSENCE(player))
- {
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ETERNOS1, creature->GetGUID());
- }
- else
+ switch (action)
{
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ETERNOS2, creature->GetGUID());
+ case GOSSIP_ACTION_INFO_DEF + 1:
+ if (!HAS_ESSENCE(player))
+ {
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ETERNOS1, creature->GetGUID());
+ }
+ else
+ {
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
+ player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ETERNOS2, creature->GetGUID());
+ }
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2:
+ {
+ ItemPosCountVec dest;
+ uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_AMBER_ESSENCE, 1);
+ if (msg == EQUIP_ERR_OK)
+ player->StoreNewItem(dest, ITEM_AMBER_ESSENCE, true);
+ player->CLOSE_GOSSIP_MENU();
+ break;
+ }
+ case GOSSIP_ACTION_INFO_DEF + 3:
+ player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ETERNOS3, creature->GetGUID());
+ break;
}
break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- {
- ItemPosCountVec dest;
- uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_AMBER_ESSENCE, 1);
- if (msg == EQUIP_ERR_OK)
- player->StoreNewItem(dest, ITEM_AMBER_ESSENCE, true);
- player->CLOSE_GOSSIP_MENU();
- break;
- }
- case GOSSIP_ACTION_INFO_DEF + 3:
- player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ETERNOS3, creature->GetGUID());
- break;
}
- break;
}
return true;
@@ -235,15 +239,15 @@ public:
void MovementInform(uint32 /*type*/, uint32 id)
{
+ if (id)
+ return;
+
// When Belgaristraz finish his moving say grateful text
if (me->GetEntry() == NPC_BELGARISTRASZ)
- if (id == 0)
- {
- Talk(SAY_BELGARISTRASZ);
- }
+ Talk(SAY_BELGARISTRASZ);
+
// The gossip flag should activate when Drakos die and not from DB
- if (id == 0)
- me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
+ me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
}
};
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp
index 55bb61b8c42..0ffab435a9c 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp
@@ -62,6 +62,8 @@ OPvPCapturePointHP::OPvPCapturePointHP(OutdoorPvP* pvp, OutdoorPvPHPTowerType ty
OutdoorPvPHP::OutdoorPvPHP()
{
m_TypeId = OUTDOOR_PVP_HP;
+ m_AllianceTowersControlled = 0;
+ m_HordeTowersControlled = 0;
}
bool OutdoorPvPHP::SetupOutdoorPvP()
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp
index bd6fd96451f..fe3489b4a7e 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp
@@ -27,6 +27,7 @@
OutdoorPvPNA::OutdoorPvPNA()
{
m_TypeId = OUTDOOR_PVP_NA;
+ m_obj = NULL;
}
void OutdoorPvPNA::HandleKillImpl(Player* player, Unit* killed)
@@ -216,8 +217,8 @@ bool OutdoorPvPNA::SetupOutdoorPvP()
m_obj = new OPvPCapturePointNA(this);
if (!m_obj)
return false;
- AddCapturePoint(m_obj);
+ AddCapturePoint(m_obj);
return true;
}
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp
index bd8b6cfd982..98b0ee5c5f4 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp
@@ -28,6 +28,17 @@
OutdoorPvPTF::OutdoorPvPTF()
{
m_TypeId = OUTDOOR_PVP_TF;
+
+ m_IsLocked = false;
+ m_LockTimer = TF_LOCK_TIME;
+ m_LockTimerUpdate = 0;
+
+ m_AllianceTowersControlled = 0;
+ m_HordeTowersControlled = 0;
+
+ hours_left = 6;
+ second_digit = 0;
+ first_digit = 0;
}
OPvPCapturePointTF::OPvPCapturePointTF(OutdoorPvP* pvp, OutdoorPvPTF_TowerType type)
diff --git a/src/server/shared/Cryptography/SHA1.cpp b/src/server/shared/Cryptography/SHA1.cpp
index d02e9711014..00d7e520d51 100644
--- a/src/server/shared/Cryptography/SHA1.cpp
+++ b/src/server/shared/Cryptography/SHA1.cpp
@@ -23,6 +23,7 @@
SHA1Hash::SHA1Hash()
{
SHA1_Init(&mC);
+ memset(mDigest, 0, SHA_DIGEST_LENGTH * sizeof(uint8));
}
SHA1Hash::~SHA1Hash()
diff --git a/src/server/shared/Database/Field.cpp b/src/server/shared/Database/Field.cpp
index 9bd37641813..51d918e716e 100644
--- a/src/server/shared/Database/Field.cpp
+++ b/src/server/shared/Database/Field.cpp
@@ -22,6 +22,7 @@ Field::Field()
data.value = NULL;
data.type = MYSQL_TYPE_NULL;
data.length = 0;
+ data.raw = false;
}
Field::~Field()
diff --git a/src/server/shared/Database/MySQLConnection.cpp b/src/server/shared/Database/MySQLConnection.cpp
index 846c8ce72fe..19d0a7af4c8 100644
--- a/src/server/shared/Database/MySQLConnection.cpp
+++ b/src/server/shared/Database/MySQLConnection.cpp
@@ -84,8 +84,10 @@ bool MySQLConnection::Open()
int port;
char const* unix_socket;
+ unsigned int timeout = 10;
mysql_options(mysqlInit, MYSQL_SET_CHARSET_NAME, "utf8");
+ mysql_options(mysqlInit, MYSQL_OPT_READ_TIMEOUT, (char const*)&timeout);
#ifdef _WIN32
if (m_connectionInfo.host == ".") // named pipe use option (Windows)
{
diff --git a/src/server/shared/Database/PreparedStatement.cpp b/src/server/shared/Database/PreparedStatement.cpp
index 06f9ff51132..24097ca41c5 100644
--- a/src/server/shared/Database/PreparedStatement.cpp
+++ b/src/server/shared/Database/PreparedStatement.cpp
@@ -203,6 +203,7 @@ void PreparedStatement::setNull(const uint8 index)
}
MySQLPreparedStatement::MySQLPreparedStatement(MYSQL_STMT* stmt) :
+m_stmt(NULL),
m_Mstmt(stmt),
m_bind(NULL)
{
diff --git a/src/server/shared/Threading/Callback.h b/src/server/shared/Threading/Callback.h
index f6bc1581857..e0215f5b3d3 100644
--- a/src/server/shared/Threading/Callback.h
+++ b/src/server/shared/Threading/Callback.h
@@ -35,7 +35,7 @@ template <typename Result, typename ParamType, bool chain = false>
class QueryCallback
{
public:
- QueryCallback() : _stage(chain ? 0 : CALLBACK_STAGE_INVALID) {}
+ QueryCallback() : _param(), _stage(chain ? 0 : CALLBACK_STAGE_INVALID) {}
//! The parameter of this function should be a resultset returned from either .AsyncQuery or .AsyncPQuery
void SetFutureResult(ACE_Future<Result> value)
diff --git a/src/server/worldserver/TCSoap/TCSoap.h b/src/server/worldserver/TCSoap/TCSoap.h
index b786ee94e81..63ccb6b304e 100644
--- a/src/server/worldserver/TCSoap/TCSoap.h
+++ b/src/server/worldserver/TCSoap/TCSoap.h
@@ -27,7 +27,7 @@
class TCSoapRunnable: public ACE_Based::Runnable
{
public:
- TCSoapRunnable() { }
+ TCSoapRunnable() : m_host(""), m_port(0) { }
void run();
void setListenArguments(std::string host, uint16 port)
{