aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/EventAI/CreatureEventAI.cpp2
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp1
-rw-r--r--src/server/game/Chat/Chat.cpp2
-rw-r--r--src/server/game/Combat/HostileRefManager.cpp3
-rw-r--r--src/server/game/Entities/Object/Object.cpp2
-rw-r--r--src/server/game/Entities/Unit/StatSystem.cpp1
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp2
-rw-r--r--src/server/game/Guilds/Guild.h1
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp18
-rw-r--r--src/server/scripts/Kalimdor/zone_desolace.cpp6
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp6
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp2
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp2
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp1
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_illidan.cpp3
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp19
-rw-r--r--src/server/shared/Threading/Threading.cpp8
-rw-r--r--src/tools/mmaps_generator/MapBuilder.cpp9
18 files changed, 54 insertions, 34 deletions
diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp
index d1bfc7403e9..39fcedf9a33 100644
--- a/src/server/game/AI/EventAI/CreatureEventAI.cpp
+++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp
@@ -1085,7 +1085,6 @@ inline uint32 CreatureEventAI::GetRandActionParam(uint32 rnd, uint32 param1, uin
case 1: return param2;
case 2: return param3;
}
- return 0;
}
inline int32 CreatureEventAI::GetRandActionParam(uint32 rnd, int32 param1, int32 param2, int32 param3)
@@ -1096,7 +1095,6 @@ inline int32 CreatureEventAI::GetRandActionParam(uint32 rnd, int32 param1, int32
case 1: return param2;
case 2: return param3;
}
- return 0;
}
inline Unit* CreatureEventAI::GetTargetByType(uint32 target, Unit* actionInvoker)
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index b4e18b66a69..41dae740e59 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -2231,6 +2231,7 @@ SmartScriptHolder SmartScript::CreateEvent(SMART_EVENT e, uint32 event_flags, ui
script.event.raw.param4 = event_param4;
script.event.event_phase_mask = phaseMask;
script.event.event_flags = event_flags;
+ script.event.event_chance = 100;
script.action.type = action;
script.action.raw.param1 = action_param1;
diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp
index f61380b6834..4364fb61626 100644
--- a/src/server/game/Chat/Chat.cpp
+++ b/src/server/game/Chat/Chat.cpp
@@ -342,7 +342,7 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand* table, const char* text, co
{
if (!ExecuteCommandInTable(table[i].ChildCommands, text, fullcmd))
{
- if (text && text[0] != '\0')
+ if (text[0] != '\0')
SendSysMessage(LANG_NO_SUBCMD);
else
SendSysMessage(LANG_CMD_SYNTAX);
diff --git a/src/server/game/Combat/HostileRefManager.cpp b/src/server/game/Combat/HostileRefManager.cpp
index 4cd76b4e7a2..1e550596368 100644
--- a/src/server/game/Combat/HostileRefManager.cpp
+++ b/src/server/game/Combat/HostileRefManager.cpp
@@ -35,6 +35,9 @@ HostileRefManager::~HostileRefManager()
void HostileRefManager::threatAssist(Unit* victim, float baseThreat, SpellInfo const* threatSpell)
{
+ if (getSize() == 0)
+ return;
+
HostileReference* ref = getFirst();
float threat = ThreatCalcHelper::calcThreat(victim, iOwner, baseThreat, (threatSpell ? threatSpell->GetSchoolMask() : SPELL_SCHOOL_MASK_NORMAL), threatSpell);
threat /= getSize();
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp
index ec6a3e518c4..6cd61dc043c 100644
--- a/src/server/game/Entities/Object/Object.cpp
+++ b/src/server/game/Entities/Object/Object.cpp
@@ -2230,8 +2230,6 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
case UNIT_MASK_MINION:
summon = new Minion(properties, summoner, false);
break;
- default:
- return NULL;
}
if (!summon->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), this, phase, entry, vehId, team, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation()))
diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp
index e6cc30c867a..e94fb726387 100644
--- a/src/server/game/Entities/Unit/StatSystem.cpp
+++ b/src/server/game/Entities/Unit/StatSystem.cpp
@@ -1113,7 +1113,6 @@ bool Guardian::UpdateStats(Stats stat)
{
case STAT_STAMINA: mod = 0.3f; break; // Default Owner's Stamina scale
case STAT_STRENGTH: mod = 0.7f; break; // Default Owner's Strength scale
- default: break;
}
// Check just if owner has Ravenous Dead since it's effect is not an aura
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 7e67a9e6e09..ef4829a8788 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -14568,8 +14568,6 @@ void Unit::UpdateReactives(uint32 p_time)
if (getClass() == CLASS_WARRIOR && GetTypeId() == TYPEID_PLAYER)
ToPlayer()->ClearComboPoints();
break;
- default:
- break;
}
}
else
diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h
index f6a3e095957..ac2ae2c967b 100644
--- a/src/server/game/Guilds/Guild.h
+++ b/src/server/game/Guilds/Guild.h
@@ -292,6 +292,7 @@ private:
m_zoneId(0),
m_level(0),
m_class(0),
+ m_flags(GUILDMEMBER_STATUS_NONE),
m_logoutTime(::time(NULL)),
m_accountId(0),
m_rankId(rankId)
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
index 2abfcead826..fffd6be8e9b 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
@@ -367,21 +367,21 @@ public:
std::vector<InfernalPoint*>::iterator itr = positions.begin()+rand()%positions.size();
point = *itr;
positions.erase(itr);
- pos.Relocate(point->x, point->y, INFERNAL_Z);
+ pos.Relocate(point->x, point->y, INFERNAL_Z, 0.0f);
}
- Creature* Infernal = me->SummonCreature(NETHERSPITE_INFERNAL, pos, TEMPSUMMON_TIMED_DESPAWN, 180000);
+ Creature* infernal = me->SummonCreature(NETHERSPITE_INFERNAL, pos, TEMPSUMMON_TIMED_DESPAWN, 180000);
- if (Infernal)
+ if (infernal)
{
- Infernal->SetDisplayId(INFERNAL_MODEL_INVISIBLE);
- Infernal->setFaction(me->getFaction());
+ infernal->SetDisplayId(INFERNAL_MODEL_INVISIBLE);
+ infernal->setFaction(me->getFaction());
if (point)
- CAST_AI(netherspite_infernal::netherspite_infernalAI, Infernal->AI())->point=point;
- CAST_AI(netherspite_infernal::netherspite_infernalAI, Infernal->AI())->malchezaar=me->GetGUID();
+ CAST_AI(netherspite_infernal::netherspite_infernalAI, infernal->AI())->point=point;
+ CAST_AI(netherspite_infernal::netherspite_infernalAI, infernal->AI())->malchezaar=me->GetGUID();
- infernals.push_back(Infernal->GetGUID());
- DoCast(Infernal, SPELL_INFERNAL_RELAY);
+ infernals.push_back(infernal->GetGUID());
+ DoCast(infernal, SPELL_INFERNAL_RELAY);
}
Talk(SAY_SUMMON);
diff --git a/src/server/scripts/Kalimdor/zone_desolace.cpp b/src/server/scripts/Kalimdor/zone_desolace.cpp
index 882bc176932..05496c0fcda 100644
--- a/src/server/scripts/Kalimdor/zone_desolace.cpp
+++ b/src/server/scripts/Kalimdor/zone_desolace.cpp
@@ -161,9 +161,9 @@ public:
{
if (quest->GetQuestId() == QUEST_RETURN_TO_VAHLARRIEL)
{
- if (npc_escortAI* pEscortAI = CAST_AI(npc_dalinda::npc_dalindaAI, creature->AI()))
+ if (npc_escortAI* escortAI = CAST_AI(npc_dalinda::npc_dalindaAI, creature->AI()))
{
- pEscortAI->Start(true, false, player->GetGUID());
+ escortAI->Start(true, false, player->GetGUID());
creature->setFaction(113);
}
}
@@ -186,7 +186,7 @@ public:
switch (waypointId)
{
case 1:
- me->IsStandState();
+ me->SetStandState(UNIT_STAND_STATE_STAND);
break;
case 15:
if (player)
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp
index a9f92521ef8..f438a117a5f 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp
@@ -1001,6 +1001,8 @@ public:
void Reset() OVERRIDE
{
+ dummy_dragonAI::Reset();
+
m_uiShadowBreathTimer = 20000;
m_uiShadowFissureTimer = 5000;
m_uiHatchEggTimer = 30000;
@@ -1090,6 +1092,8 @@ public:
void Reset() OVERRIDE
{
+ dummy_dragonAI::Reset();
+
m_uiShadowBreathTimer = 20000;
m_uiShadowFissureTimer = 5000;
m_uiAcolyteShadronTimer = 60000;
@@ -1194,6 +1198,8 @@ public:
void Reset() OVERRIDE
{
+ dummy_dragonAI::Reset();
+
m_uiShadowBreathTimer = 20000;
m_uiShadowFissureTimer = 5000;
m_uiAcolyteVesperonTimer = 60000;
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
index 13c9bbd722c..0d2a424b4c7 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
@@ -836,8 +836,6 @@ class npc_halion_controller : public CreatureScript
_twilightDamageTaken = 0;
return;
}
- default:
- break;
}
_materialDamageTaken = 0;
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp
index 4ece79b0f7f..bbb3d666b32 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp
@@ -112,6 +112,7 @@ public:
Charge_Timer = 5000;
StoneStrike_Timer = 10000;
Dalronn_isDead = false;
+ Response_Timer = 0;
Check_Timer = 5000;
Enraged = false;
@@ -280,6 +281,7 @@ public:
Summon_Timer = 10000;
Check_Timer = 5000;
Skarvald_isDead = false;
+ Response_Timer = 0;
AggroYell_Timer = 0;
ghost = me->GetEntry() == NPC_DALRONN_GHOST;
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp
index a54a1b6bec7..f592a4b2bb2 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp
@@ -159,6 +159,7 @@ public:
void Reset() OVERRIDE
{
+ m_bIsWalking = false;
m_bIsPause = false;
m_bIsActiveWithBJORN = false;
m_bIsActiveWithHALDOR = false;
diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
index 4dedc774bb8..279a846140c 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
@@ -478,6 +478,7 @@ public:
{
instance = creature->GetInstanceScript();
DoCast(me, SPELL_DUAL_WIELD, true);
+ AkamaGUID = 0;
}
void Reset() OVERRIDE;
@@ -1081,7 +1082,7 @@ public:
{
case EVENT_SHADOW_BLAST:
me->GetMotionMaster()->Clear(false);
- if (!me->IsWithinDistInMap(me->GetVictim(), 50)||!me->IsWithinLOSInMap(me->GetVictim()))
+ if (me->GetVictim() && (!me->IsWithinDistInMap(me->GetVictim(), 50) || !me->IsWithinLOSInMap(me->GetVictim())))
me->GetMotionMaster()->MoveChase(me->GetVictim(), 30);
else
me->GetMotionMaster()->MoveIdle();
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
index 4499cb98475..ff66dcb550c 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
@@ -151,6 +151,8 @@ public:
Intro = false;
JustCreated = true;
creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // set it only once on Creature create (no need do intro if wiped)
+ for (uint8 i = 0; i < 4; ++i)
+ ShieldGeneratorChannel[i] = 0;
}
InstanceScript* instance;
@@ -201,17 +203,20 @@ public:
JustCreated = false;
} else CanAttack = true;
-
for (uint8 i = 0; i < 4; ++i)
- if (Unit* remo = Unit::GetUnit(*me, ShieldGeneratorChannel[i]))
- remo->setDeathState(JUST_DIED);
+ {
+ if (ShieldGeneratorChannel[i])
+ {
+ if (Unit* remo = Unit::GetUnit(*me, ShieldGeneratorChannel[i]))
+ {
+ remo->setDeathState(JUST_DIED);
+ ShieldGeneratorChannel[i] = 0;
+ }
+ }
+ }
if (instance)
instance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED);
- ShieldGeneratorChannel[0] = 0;
- ShieldGeneratorChannel[1] = 0;
- ShieldGeneratorChannel[2] = 0;
- ShieldGeneratorChannel[3] = 0;
me->SetCorpseDelay(1000*60*60);
}
diff --git a/src/server/shared/Threading/Threading.cpp b/src/server/shared/Threading/Threading.cpp
index 34a7bf8bb9d..1ed29d5106a 100644
--- a/src/server/shared/Threading/Threading.cpp
+++ b/src/server/shared/Threading/Threading.cpp
@@ -59,10 +59,10 @@ ThreadPriority::ThreadPriority()
}
}
- //since we have only 7(seven) values in enum Priority
- //and 3 we know already (Idle, Normal, Realtime) so
- //we need to split each list [Idle...Normal] and [Normal...Realtime]
- //into piecies
+ // since we have only 7(seven) values in enum Priority
+ // and 3 we know already (Idle, Normal, Realtime) so
+ // we need to split each list [Idle...Normal] and [Normal...Realtime]
+ // into pieces
const size_t _divider = 4;
size_t _div = (norm_pos - min_pos) / _divider;
if (_div == 0)
diff --git a/src/tools/mmaps_generator/MapBuilder.cpp b/src/tools/mmaps_generator/MapBuilder.cpp
index a8254eb5eaf..ab584e27e03 100644
--- a/src/tools/mmaps_generator/MapBuilder.cpp
+++ b/src/tools/mmaps_generator/MapBuilder.cpp
@@ -246,11 +246,20 @@ namespace MMAP
printf("Building mesh from file\n");
int tileX, tileY, mapId;
if (fread(&mapId, sizeof(int), 1, file) != 1)
+ {
+ fclose(file);
return;
+ }
if (fread(&tileX, sizeof(int), 1, file) != 1)
+ {
+ fclose(file);
return;
+ }
if (fread(&tileY, sizeof(int), 1, file) != 1)
+ {
+ fclose(file);
return;
+ }
dtNavMesh* navMesh = NULL;
buildNavMesh(mapId, navMesh);