aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2012-02-23 13:01:16 +0100
committerShauren <shauren.trinity@gmail.com>2012-02-23 13:01:16 +0100
commitdc28b924151374776aefa04935379ad095eb4c06 (patch)
tree011094e08fea11d09cc6643a8284702f43c948f6 /src/server/scripts
parentdbd8cbcfc4e5f89da98551db90e34a91ed339f3d (diff)
Core: Random cleanup + compile fix
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Commands/cs_account.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp12
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp4
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp2
-rw-r--r--src/server/scripts/World/npcs_special.cpp2
5 files changed, 9 insertions, 14 deletions
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp
index 7372c92c4dd..df83fe8118f 100644
--- a/src/server/scripts/Commands/cs_account.cpp
+++ b/src/server/scripts/Commands/cs_account.cpp
@@ -502,11 +502,12 @@ public:
stmt->setUInt32(0, targetAccountId);
stmt->setUInt32(1, realmID);
}
+
LoginDatabase.Execute(stmt);
if (gm != 0)
{
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT_ACCESS);
+ stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT_ACCESS);
stmt->setUInt32(0, targetAccountId);
stmt->setUInt8(1, uint8(gm));
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
index 41806dcb308..02a8de14fdf 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
@@ -660,17 +660,9 @@ public:
DoScriptText(RAND(SAY_KJ_REFLECTION1, SAY_KJ_REFLECTION2), me);
for (uint8 i = 0; i < 4; ++i)
{
- float x, y, z;
- Unit* target = NULL;
- for (uint8 i = 0; i < 6; ++i)
- {
- target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
- if (!target || !target->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, 0))
- break;
- }
-
- if (target)
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true, -SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT))
{
+ float x, y, z;
target->GetPosition(x, y, z);
if (Creature* pSinisterReflection = me->SummonCreature(CREATURE_SINISTER_REFLECTION, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0))
{
diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp
index 0f4b046f7d5..636be5e29be 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp
@@ -389,8 +389,10 @@ public:
bool OnGossipHello(Player* /*player*/, GameObject* pGO)
{
InstanceScript* instance = pGO->GetInstanceScript();
+ if (!instance)
+ return true;
- Creature* pPrinceTaldaram = Unit::GetCreature(*pGO, instance ? instance->GetData64(DATA_PRINCE_TALDARAM) : 0);
+ Creature* pPrinceTaldaram = Unit::GetCreature(*pGO, instance->GetData64(DATA_PRINCE_TALDARAM));
if (pPrinceTaldaram && pPrinceTaldaram->isAlive())
{
// maybe these are hacks :(
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp
index 9fcfcfa47e5..7c82454ba87 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp
@@ -208,7 +208,7 @@ public:
switch (i)
{
case 2:
- if ((instance && uiWaypointPath == 3) || uiWaypointPath == 2)
+ if (instance && (uiWaypointPath == 3 || uiWaypointPath == 2))
instance->SetData(DATA_MOVEMENT_DONE, instance->GetData(DATA_MOVEMENT_DONE)+1);
break;
case 3:
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index 4674d4584e1..8513eae5876 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -137,8 +137,8 @@ public:
if (!spawnedTemplate)
{
- SpawnAssoc = NULL;
sLog->outErrorDb("TCSR: Creature template entry %u does not exist in DB, which is required by npc_air_force_bots", SpawnAssoc->spawnedCreatureEntry);
+ SpawnAssoc = NULL;
return;
}
}