aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp9
-rw-r--r--src/server/game/Handlers/ItemHandler.cpp5
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp11
-rw-r--r--src/server/scripts/Northrend/zone_icecrown.cpp13
4 files changed, 18 insertions, 20 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 8a970963c37..817aafb18dc 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -8362,15 +8362,6 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
return false;
}
- if (vItems->GetItemCount() >= MAX_VENDOR_ITEMS)
- {
- if (player)
- ChatHandler(player->GetSession()).SendSysMessage(LANG_COMMAND_ADDVENDORITEMITEMS);
- else
- TC_LOG_ERROR(LOG_FILTER_SQL, "Table `npc_vendor` has too many items (%u >= %i) for vendor (Entry: %u), ignore", vItems->GetItemCount(), MAX_VENDOR_ITEMS, vendor_entry);
- return false;
- }
-
return true;
}
diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp
index 90c1bc4599f..5f458edbb07 100644
--- a/src/server/game/Handlers/ItemHandler.cpp
+++ b/src/server/game/Handlers/ItemHandler.cpp
@@ -784,8 +784,6 @@ void WorldSession::SendListInventory(uint64 vendorGuid)
continue;
}
- ++count;
-
// reputation discount
int32 price = item->IsGoldRequired(itemTemplate) ? uint32(floor(itemTemplate->BuyPrice * discountMod)) : 0;
@@ -797,6 +795,9 @@ void WorldSession::SendListInventory(uint64 vendorGuid)
data << uint32(itemTemplate->MaxDurability);
data << uint32(itemTemplate->BuyCount);
data << uint32(item->ExtendedCost);
+
+ if (++count >= MAX_VENDOR_ITEMS)
+ break;
}
}
}
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp
index ddcd4c7d824..2895e85de71 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp
@@ -545,11 +545,12 @@ public:
bool OnGossipHello(Player* player, GameObject* go) OVERRIDE
{
- uint8 SpectralPlayers = 0;
Map* map = go->GetMap();
if (!map->IsDungeon())
return true;
+#if MAX_PLAYERS_IN_SPECTRAL_REALM > 0
+ uint8 SpectralPlayers = 0;
Map::PlayerList const &PlayerList = map->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
@@ -558,9 +559,13 @@ public:
}
if (player->HasAura(AURA_SPECTRAL_EXHAUSTION) || SpectralPlayers >= MAX_PLAYERS_IN_SPECTRAL_REALM)
+ {
player->GetSession()->SendNotification(GO_FAILED);
- else
- player->CastSpell(player, SPELL_TELEPORT_SPECTRAL, true);
+ return true;
+ }
+#endif
+
+ player->CastSpell(player, SPELL_TELEPORT_SPECTRAL, true);
return true;
}
};
diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp
index a5d3ed7d0d5..24452a5fb5f 100644
--- a/src/server/scripts/Northrend/zone_icecrown.cpp
+++ b/src/server/scripts/Northrend/zone_icecrown.cpp
@@ -1035,11 +1035,12 @@ class npc_margrave_dhakar : public CreatureScript
if (Creature* morbidus = me->FindNearestCreature(NPC_MORBIDUS, 50.0f, true))
{
- Creature* lichKing = me->SummonCreature(NPC_LICH_KING, morbidus->GetPositionX()+10, morbidus->GetPositionY(), morbidus->GetPositionZ());
- _lichKingGuid = lichKing->GetGUID();
- lichKing = me->SummonCreature(NPC_LICH_KING, morbidus->GetPositionX()+10, morbidus->GetPositionY(), morbidus->GetPositionZ());
- lichKing->SetFacingTo(morbidus->GetOrientation());
- lichKing->CastSpell(lichKing, SPELL_SIMPLE_TELEPORT, true);
+ if (Creature* lichKing = me->SummonCreature(NPC_LICH_KING, morbidus->GetPositionX() + 10.0f, morbidus->GetPositionY(), morbidus->GetPositionZ()))
+ {
+ _lichKingGuid = lichKing->GetGUID();
+ lichKing->SetFacingTo(morbidus->GetOrientation());
+ lichKing->CastSpell(lichKing, SPELL_SIMPLE_TELEPORT, true);
+ }
}
_events.ScheduleEvent(EVENT_LK_SAY_1, 5000);
@@ -1109,8 +1110,8 @@ class npc_margrave_dhakar : public CreatureScript
private:
EventMap _events;
- uint64 _lichKingGuid;
SummonList _summons;
+ uint64 _lichKingGuid;
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE