Random minor code cleanup
This commit is contained in:
@@ -62,17 +62,6 @@ namespace VMAP
|
||||
return pos;
|
||||
}
|
||||
|
||||
Vector3 VMapManager2::convertPositionToMangosRep(float x, float y, float z) const
|
||||
{
|
||||
Vector3 pos;
|
||||
const float mid = 0.5f * 64.0f * 533.33333333f;
|
||||
pos.x = mid - x;
|
||||
pos.y = mid - y;
|
||||
pos.z = z;
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
||||
// move to MapTree too?
|
||||
std::string VMapManager2::getMapFileName(unsigned int mapId)
|
||||
{
|
||||
@@ -175,7 +164,7 @@ namespace VMAP
|
||||
Vector3 pos2 = convertPositionToInternalRep(x2, y2, z2);
|
||||
Vector3 resultPos;
|
||||
bool result = instanceTree->second->getObjectHitPos(pos1, pos2, resultPos, modifyDist);
|
||||
resultPos = convertPositionToMangosRep(resultPos.x, resultPos.y, resultPos.z);
|
||||
resultPos = convertPositionToInternalRep(resultPos.x, resultPos.y, resultPos.z);
|
||||
rx = resultPos.x;
|
||||
ry = resultPos.y;
|
||||
rz = resultPos.z;
|
||||
@@ -222,7 +211,7 @@ namespace VMAP
|
||||
{
|
||||
Vector3 pos = convertPositionToInternalRep(x, y, z);
|
||||
bool result = instanceTree->second->getAreaInfo(pos, flags, adtId, rootId, groupId);
|
||||
// z is not touched by convertPositionToMangosRep(), so just copy
|
||||
// z is not touched by convertPositionToInternalRep(), so just copy
|
||||
z = pos.z;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -78,7 +78,6 @@ namespace VMAP
|
||||
public:
|
||||
// public for debug
|
||||
G3D::Vector3 convertPositionToInternalRep(float x, float y, float z) const;
|
||||
G3D::Vector3 convertPositionToMangosRep(float x, float y, float z) const;
|
||||
static std::string getMapFileName(unsigned int mapId);
|
||||
|
||||
VMapManager2();
|
||||
|
||||
@@ -505,9 +505,8 @@ namespace VMAP
|
||||
if (!wf)
|
||||
return false;
|
||||
|
||||
bool result = true;
|
||||
uint32 chunkSize, count;
|
||||
result = fwrite(VMAP_MAGIC, 1, 8, wf) == 8;
|
||||
bool result = fwrite(VMAP_MAGIC, 1, 8, wf) == 8;
|
||||
if (result && fwrite("WMOD", 1, 4, wf) != 4) result = false;
|
||||
chunkSize = sizeof(uint32) + sizeof(uint32);
|
||||
if (result && fwrite(&chunkSize, sizeof(uint32), 1, wf) != 1) result = false;
|
||||
|
||||
@@ -506,11 +506,9 @@ void AchievementMgr::SaveToDB(SQLTransaction& trans)
|
||||
iter->second.changed = false;
|
||||
}
|
||||
|
||||
if (need_execute)
|
||||
ssdel << ')';
|
||||
|
||||
if (need_execute)
|
||||
{
|
||||
ssdel << ')';
|
||||
trans->Append(ssdel.str().c_str());
|
||||
trans->Append(ssins.str().c_str());
|
||||
}
|
||||
|
||||
@@ -907,8 +907,7 @@ bool BattlegroundMgr::IsArenaType(BattlegroundTypeId bgTypeId)
|
||||
bgTypeId == BATTLEGROUND_NA ||
|
||||
bgTypeId == BATTLEGROUND_DS ||
|
||||
bgTypeId == BATTLEGROUND_RV ||
|
||||
bgTypeId == BATTLEGROUND_RL ||
|
||||
bgTypeId == BATTLEGROUND_DS);
|
||||
bgTypeId == BATTLEGROUND_RL);
|
||||
}
|
||||
|
||||
BattlegroundQueueTypeId BattlegroundMgr::BGQueueTypeId(BattlegroundTypeId bgTypeId, uint8 arenaType)
|
||||
|
||||
@@ -1540,11 +1540,8 @@ void GameObject::Use(Unit* user)
|
||||
switch (info->entry)
|
||||
{
|
||||
case 179785: // Silverwing Flag
|
||||
// check if it's correct bg
|
||||
if (bg->IsRandom() ? bg->GetTypeID(true) : bg->GetTypeID(false) == BATTLEGROUND_WS)
|
||||
bg->EventPlayerClickedOnFlag(player, this);
|
||||
break;
|
||||
case 179786: // Warsong Flag
|
||||
// check if it's correct bg
|
||||
if (bg->IsRandom() ? bg->GetTypeID(true) : bg->GetTypeID(false) == BATTLEGROUND_WS)
|
||||
bg->EventPlayerClickedOnFlag(player, this);
|
||||
break;
|
||||
|
||||
@@ -9057,11 +9057,7 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)
|
||||
case 3698:
|
||||
case 3702:
|
||||
case 3968:
|
||||
NumberOfFields = 11;
|
||||
break;
|
||||
case 4378:
|
||||
NumberOfFields = 11;
|
||||
break;
|
||||
case 3703:
|
||||
NumberOfFields = 11;
|
||||
break;
|
||||
@@ -9072,8 +9068,6 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)
|
||||
NumberOfFields = 28;
|
||||
break;
|
||||
case 4812: // Icecrown Citadel
|
||||
NumberOfFields = 13;
|
||||
break;
|
||||
case 4100: // The Culling of Stratholme
|
||||
NumberOfFields = 13;
|
||||
break;
|
||||
|
||||
@@ -199,7 +199,7 @@ bool SpellClickInfo::IsFitToRequirements(Unit const* clicker, Unit const* clicke
|
||||
if (questStart)
|
||||
{
|
||||
// not in expected required quest state
|
||||
if (((!questStartCanActive || !playerClicker->IsActiveQuest(questStart)) && !playerClicker->GetQuestRewardStatus(questStart)))
|
||||
if ((!questStartCanActive || !playerClicker->IsActiveQuest(questStart)) && !playerClicker->GetQuestRewardStatus(questStart))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -137,10 +137,7 @@ class boss_renataki : public CreatureScript
|
||||
|
||||
Aggro_Timer = 7000 + rand()%13000;
|
||||
} else Aggro_Timer -= diff;
|
||||
}
|
||||
|
||||
if (!Invisible)
|
||||
{
|
||||
if (ThousandBlades_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_THOUSANDBLADES);
|
||||
|
||||
@@ -590,7 +590,7 @@ public:
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_STINKYS_ESCAPE_H || QUEST_STINKYS_ESCAPE_A)
|
||||
if (quest->GetQuestId() == QUEST_STINKYS_ESCAPE_H || quest->GetQuestId() == QUEST_STINKYS_ESCAPE_A)
|
||||
{
|
||||
if (npc_stinkyAI* pEscortAI = CAST_AI(npc_stinky::npc_stinkyAI, creature->AI()))
|
||||
{
|
||||
|
||||
+2
-2
@@ -160,7 +160,7 @@ class boss_baltharus_the_warborn : public CreatureScript
|
||||
DoAction(ACTION_CLONE);
|
||||
}
|
||||
|
||||
if (me->GetHealth() - damage > 0)
|
||||
if (me->GetHealth() > damage)
|
||||
instance->SetData(DATA_BALTHARUS_SHARED_HEALTH, me->GetHealth() - damage);
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ class npc_baltharus_the_warborn_clone : public CreatureScript
|
||||
void DamageTaken(Unit* /*attacker*/, uint32& damage)
|
||||
{
|
||||
// Setting DATA_BALTHARUS_SHARED_HEALTH to 0 when killed would bug the boss.
|
||||
if (_instance && me->GetHealth() - damage > 0)
|
||||
if (_instance && me->GetHealth() > damage)
|
||||
_instance->SetData(DATA_BALTHARUS_SHARED_HEALTH, me->GetHealth() - damage);
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,6 @@ class instance_ulduar : public InstanceMapScript
|
||||
AlgalonGUID = 0;
|
||||
KologarnChestGUID = 0;
|
||||
KologarnBridgeGUID = 0;
|
||||
KologarnChestGUID = 0;
|
||||
ThorimChestGUID = 0;
|
||||
HodirRareCacheGUID = 0;
|
||||
HodirChestGUID = 0;
|
||||
|
||||
@@ -129,7 +129,6 @@ class boss_high_astromancer_solarian : public CreatureScript
|
||||
AppearDelay = false;
|
||||
Wrath_Timer = 20000+rand()%5000;//twice in phase one
|
||||
Phase = 1;
|
||||
Wrath_Timer = 20000+rand()%5000;//twice in phase one
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, NOT_STARTED);
|
||||
|
||||
@@ -503,7 +503,8 @@ public:
|
||||
if (me->IsWithinDistInMap(who, 50.0f))
|
||||
{
|
||||
if (who->GetTypeId() == TYPEID_PLAYER)
|
||||
if (who->ToPlayer()->GetQuestStatus(QUEST_GETTING_THE_BLADESPIRE_TANKED || QUEST_BLADESPIRE_KEGGER) == QUEST_STATUS_INCOMPLETE)
|
||||
if (who->ToPlayer()->GetQuestStatus(QUEST_GETTING_THE_BLADESPIRE_TANKED) == QUEST_STATUS_INCOMPLETE
|
||||
|| who->ToPlayer()->GetQuestStatus(QUEST_BLADESPIRE_KEGGER) == QUEST_STATUS_INCOMPLETE)
|
||||
PlayerGUID = who->GetGUID();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user