Merge remote-tracking branch 'origin/master' into mmaps

Conflicts:
	src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
This commit is contained in:
Nay
2012-09-04 19:11:04 +01:00
21 changed files with 535 additions and 519 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ double inf() {
}
bool isNaN(float x) {
static const float n = nan();
static const float n = fnan();
return memcmp(&x, &n, sizeof(float)) == 0;
}
@@ -364,7 +364,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un
return sScriptMgr->OnCriteriaCheck(this, const_cast<Player*>(source), const_cast<Unit*>(target));
case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY:
if (source->GetMap()->IsRaid())
if (source->GetMap()->Is25ManRaid() != (difficulty.difficulty & RAID_DIFFICULTY_MASK_25MAN))
if (source->GetMap()->Is25ManRaid() != ((difficulty.difficulty & RAID_DIFFICULTY_MASK_25MAN) != 0))
return false;
return source->GetMap()->GetSpawnMode() >= difficulty.difficulty;
case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT:
@@ -60,6 +60,13 @@ Battlefield::Battlefield()
Battlefield::~Battlefield()
{
for (BfCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
delete itr->second;
for (GraveyardVect::const_iterator itr = m_GraveyardList.begin(); itr != m_GraveyardList.end(); ++itr)
delete *itr;
m_capturePoints.clear();
}
// Called when a player enters the zone
@@ -37,6 +37,9 @@ BattlefieldWG::~BattlefieldWG()
{
for (Workshop::const_iterator itr = WorkshopsList.begin(); itr != WorkshopsList.end(); ++itr)
delete *itr;
for (GameObjectBuilding::const_iterator itr = BuildingsInZone.begin(); itr != BuildingsInZone.end(); ++itr)
delete *itr;
}
bool BattlefieldWG::SetupBattlefield()
@@ -371,9 +371,10 @@ void BattlegroundAB::_NodeOccupied(uint8 node, Team team)
if (node >= BG_AB_DYNAMIC_NODES_COUNT)//only dynamic nodes, no start points
return;
Creature* trigger = GetBGCreature(node+7);//0-6 spirit guides
Creature* trigger = BgCreatures[node+7] ? GetBGCreature(node+7) : NULL;//0-6 spirit guides
if (!trigger)
trigger = AddCreature(WORLD_TRIGGER, node+7, team, BG_AB_NodePositions[node][0], BG_AB_NodePositions[node][1], BG_AB_NodePositions[node][2], BG_AB_NodePositions[node][3]);
trigger = AddCreature(WORLD_TRIGGER, node+7, team, BG_AB_NodePositions[node][0], BG_AB_NodePositions[node][1], BG_AB_NodePositions[node][2], BG_AB_NodePositions[node][3]);
//add bonus honor aura trigger creature when node is accupied
//cast bonus aura (+50% honor in 25yards)
+6
View File
@@ -98,6 +98,12 @@ void Totem::InitSummon()
void Totem::UnSummon(uint32 msTime)
{
if (msTime)
{
m_Events.AddEvent(new ForcedUnsummonDelayEvent(*this), m_Events.CalculateTime(msTime));
return;
}
CombatStop();
RemoveAurasDueToSpell(GetSpell(), GetGUID());
+10 -8
View File
@@ -12266,19 +12266,21 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo
if (GetReactionTo(target) == REP_NEUTRAL &&
target->GetReactionTo(this) == REP_NEUTRAL)
{
if (
!(target->GetTypeId() == TYPEID_PLAYER && GetTypeId() == TYPEID_PLAYER) &&
!(target->GetTypeId() == TYPEID_UNIT && GetTypeId() == TYPEID_UNIT)
)
if (!(target->GetTypeId() == TYPEID_PLAYER && GetTypeId() == TYPEID_PLAYER) &&
!(target->GetTypeId() == TYPEID_UNIT && GetTypeId() == TYPEID_UNIT))
{
Player const* player = target->GetTypeId() == TYPEID_PLAYER ? target->ToPlayer() : ToPlayer();
Unit const* creature = target->GetTypeId() == TYPEID_UNIT ? target : this;
if (FactionTemplateEntry const* factionTemplate = creature->getFactionTemplateEntry())
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->faction))
if (FactionState const* repState = player->GetReputationMgr().GetState(factionEntry))
if (!(repState->Flags & FACTION_FLAG_AT_WAR))
return false;
{
if (!(player->GetReputationMgr().GetForcedRankIfAny(factionTemplate)))
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->faction))
if (FactionState const* repState = player->GetReputationMgr().GetState(factionEntry))
if (!(repState->Flags & FACTION_FLAG_AT_WAR))
return false;
}
}
}
+2 -2
View File
@@ -1241,8 +1241,8 @@ bool GridMap::loadLiquidData(FILE* in, uint32 offset, uint32 /*size*/)
}
if (!(header.flags & MAP_LIQUID_NO_HEIGHT))
{
_liquidMap = new float[_liquidWidth*_liquidHeight];
if (fread(_liquidMap, sizeof(float), _liquidWidth*_liquidHeight, in) != _liquidWidth*_liquidHeight)
_liquidMap = new float[uint32(_liquidWidth) * uint32(_liquidHeight)];
if (fread(_liquidMap, sizeof(float), _liquidWidth*_liquidHeight, in) != (uint32(_liquidWidth) * uint32(_liquidHeight)))
return false;
}
return true;
@@ -47,6 +47,11 @@ void FleeingMovementGenerator<T>::_setTargetLocation(T* owner)
path.setPathLengthLimit(30.0f);
path.CalculatePath(x, y, z);
if (path.getPathType() & PATHFIND_NOPATH)
default:
angle = 0.0f;
distance = 0.0f;
break;
{
i_nextCheckTime.Reset(urand(1000, 1500));
return;
+11 -4
View File
@@ -766,7 +766,7 @@ void Aura::SetCharges(uint8 charges)
uint8 Aura::CalcMaxCharges(Unit* caster) const
{
uint8 maxProcCharges = m_spellInfo->ProcCharges;
uint32 maxProcCharges = m_spellInfo->ProcCharges;
if (SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(GetId()))
maxProcCharges = procEntry->charges;
@@ -1414,10 +1414,16 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
if (caster->GetTypeId() == TYPEID_PLAYER)
{
if (caster->ToPlayer()->HasSpellCooldown(aura->GetId()))
break;
// and add if needed
caster->ToPlayer()->AddSpellCooldown(aura->GetId(), 0, uint32(time(NULL) + 12));
{
// This additional check is needed to add a minimal delay before cooldown in in effect
// to allow all bubbles broken by a single damage source proc mana return
if (caster->ToPlayer()->GetSpellCooldownDelay(aura->GetId()) <= 11)
break;
}
else // and add if needed
caster->ToPlayer()->AddSpellCooldown(aura->GetId(), 0, uint32(time(NULL) + 12));
}
// effect on caster
if (AuraEffect const* aurEff = aura->GetEffect(0))
{
@@ -2062,6 +2068,7 @@ void Aura::LoadScripts()
{
std::list<AuraScript*>::iterator bitr = itr;
++itr;
delete (*bitr);
m_loadedScripts.erase(bitr);
continue;
}
+3 -2
View File
@@ -3026,7 +3026,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
if (m_caster->GetTypeId() == TYPEID_PLAYER)
{
m_caster->ToPlayer()->SetSpellModTakingSpell(this, false);
// Set casttime to 0 if .cheat casttime is enabled.
if (m_caster->ToPlayer()->GetCommandStatus(CHEAT_CASTTIME))
m_casttime = 0;
@@ -3324,7 +3324,7 @@ void Spell::cast(bool skipCheck)
if (m_caster->GetTypeId() == TYPEID_PLAYER)
{
m_caster->ToPlayer()->SetSpellModTakingSpell(this, false);
//Clear spell cooldowns after every spell is cast if .cheat cooldown is enabled.
if (m_caster->ToPlayer()->GetCommandStatus(CHEAT_COOLDOWN))
m_caster->ToPlayer()->RemoveSpellCooldown(m_spellInfo->Id, true);
@@ -6964,6 +6964,7 @@ void Spell::LoadScripts()
{
std::list<SpellScript*>::iterator bitr = itr;
++itr;
delete (*bitr);
m_loadedScripts.erase(bitr);
continue;
}
+1 -1
View File
@@ -361,7 +361,7 @@ bool SpellEffectInfo::IsAura() const
bool SpellEffectInfo::IsAura(AuraType aura) const
{
return IsAura() && ApplyAuraName == aura;
return IsAura() && ApplyAuraName == uint32(aura);
}
bool SpellEffectInfo::IsTargetingArea() const
File diff suppressed because it is too large Load Diff
@@ -190,7 +190,7 @@ class npc_wyrmrest_defender : public CreatureScript
npc_wyrmrest_defender() : CreatureScript("npc_wyrmrest_defender") { }
bool OnGossipHello(Player* player, Creature* creature)
{
{
if (player->GetQuestStatus(QUEST_DEFENDING_WYRMREST_TEMPLE) == QUEST_STATUS_INCOMPLETE)
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
@@ -160,7 +160,7 @@ class go_broggok_lever : public GameObjectScript
public:
go_broggok_lever() : GameObjectScript("go_broggok_lever") {}
bool OnGossipHello(Player* player, GameObject* go)
bool OnGossipHello(Player* /*player*/, GameObject* go)
{
if (InstanceScript* instance = go->GetInstanceScript())
if (instance->GetData(TYPE_BROGGOK_EVENT) != DONE && instance->GetData(TYPE_BROGGOK_EVENT) != IN_PROGRESS)
@@ -316,7 +316,6 @@ class instance_blood_furnace : public InstanceMapScript
if (!prisoner->isAlive())
prisoner->Respawn(true);
prisoner->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE);
prisoner->GetMotionMaster()->MoveTargetedHome();
}
void StorePrisoner(Creature* creature)
@@ -409,11 +409,12 @@ void WheatyExceptionReport::printTracesForAllThreads()
CONTEXT context;
context.ContextFlags = 0xffffffff;
HANDLE threadHandle = OpenThread(THREAD_GET_CONTEXT | THREAD_QUERY_INFORMATION, false, te32.th32ThreadID);
if (threadHandle && GetThreadContext(threadHandle, &context))
if (threadHandle)
{
WriteStackDetails(&context, false, threadHandle);
if (GetThreadContext(threadHandle, &context))
WriteStackDetails(&context, false, threadHandle);
CloseHandle(threadHandle);
}
CloseHandle(threadHandle);
}
} while (Thread32Next(hThreadSnap, &te32));
@@ -521,7 +522,7 @@ PEXCEPTION_POINTERS pExceptionInfo)
_tprintf(_T("Global Variables\r\n"));
SymEnumSymbols(GetCurrentProcess(),
(DWORD64)GetModuleHandle(szFaultingModule),
(UINT_PTR)GetModuleHandle(szFaultingModule),
0, EnumerateSymbolsCallback, 0);
// #endif // X86 Only!
@@ -989,7 +990,7 @@ PVOID pAddress)
if (!IsBadStringPtr(*(PSTR*)pAddress, 32))
{
pszCurrBuffer += sprintf(pszCurrBuffer, " = \"%.31s\"",
*(PDWORD)pAddress);
*(PSTR*)pAddress);
}
else
pszCurrBuffer += sprintf(pszCurrBuffer, " = %X",
@@ -59,7 +59,7 @@ void AppenderConsole::InitColors(std::string const& str)
void AppenderConsole::SetColor(bool stdout_stream, ColorTypes color)
{
#if PLATFORM == PLATFORWINDOWS
#if PLATFORM == PLATFORM_WINDOWS
static WORD WinColorFG[MaxColors] =
{
0, // BLACK
@@ -146,7 +146,7 @@ void AppenderConsole::SetColor(bool stdout_stream, ColorTypes color)
void AppenderConsole::ResetColor(bool stdout_stream)
{
#if PLATFORM == PLATFORWINDOWS
#if PLATFORM == PLATFORM_WINDOWS
HANDLE hConsole = GetStdHandle(stdout_stream ? STD_OUTPUT_HANDLE : STD_ERROR_HANDLE);
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);
#else
+1 -1
View File
@@ -92,7 +92,7 @@ Tokens::Tokens(const std::string &src, const char sep, uint32 vectorReserve)
void stripLineInvisibleChars(std::string &str)
{
static std::string invChars = " \t\7\n";
static std::string const invChars = " \t\7\n";
size_t wpos = 0;
+1 -17
View File
@@ -51,7 +51,7 @@ std::string TimeToTimestampStr(time_t t);
inline uint32 secsToTimeBitFields(time_t secs)
{
tm* lt = localtime(&secs);
return (lt->tm_year - 100) << 24 | lt->tm_mon << 20 | (lt->tm_mday - 1) << 14 | lt->tm_wday << 11 | lt->tm_hour << 6 | lt->tm_min;
return uint32((lt->tm_year - 100) << 24 | lt->tm_mon << 20 | (lt->tm_mday - 1) << 14 | lt->tm_wday << 11 | lt->tm_hour << 6 | lt->tm_min);
}
/* Return a random number in the range min..max; (max-min) must be smaller than 32768. */
@@ -89,22 +89,6 @@ inline bool roll_chance_i(int chance)
return chance > irand(0, 99);
}
inline void ApplyModUInt32Var(uint32& var, int32 val, bool apply)
{
int32 cur = var;
cur += (apply ? val : -val);
if (cur < 0)
cur = 0;
var = cur;
}
inline void ApplyModFloatVar(float& var, float val, bool apply)
{
var += (apply ? val : -val);
if (var < 0)
var = 0;
}
inline void ApplyPercentModFloatVar(float& var, float val, bool apply)
{
if (val == -100.0f) // prevent set var to zero
+1 -1
View File
@@ -43,5 +43,5 @@ add_dependencies(mapextractor mpq)
if( UNIX )
install(TARGETS mapextractor DESTINATION bin)
elseif( WIN32 )
install(TARGETS mapextractor DESTINATION "${CMAKE_INSTALL_PREFIX}")
install(TARGETS mapextractor DESTINATION "${CMAKE_INSTALL_PREFIX}")
endif()