mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[10432] Rename ASSERT -> MANGOS_ASSERT and related fixes
ASSERT hard use in predictable way because diff. 3rd party libs code redefine it inf different ways and hard make sure that used in end of mangos define version. This is real detected problem make some expected assert checks ignored and so bugs not detected as expected from code. In addition made related changes: * Common.h header expected to be first include in any src/game/header except most simple cases. * Related FILE.h header expected to be first include in FILE.cpp * Fixed some absent includes and type forwards for safe build without PCH enabled. * Avoid using MANGOS_ASSERT in src/framework code
This commit is contained in:
parent
32e3e252fb
commit
acd0716297
77 changed files with 309 additions and 260 deletions
|
|
@ -26,6 +26,8 @@
|
||||||
#include "GameSystem/GridReference.h"
|
#include "GameSystem/GridReference.h"
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
class GridInfo
|
class GridInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -96,15 +98,15 @@ class MANGOS_DLL_DECL NGrid
|
||||||
|
|
||||||
const GridType& operator()(uint32 x, uint32 y) const
|
const GridType& operator()(uint32 x, uint32 y) const
|
||||||
{
|
{
|
||||||
ASSERT(x < N);
|
assert(x < N);
|
||||||
ASSERT(y < N);
|
assert(y < N);
|
||||||
return i_cells[x][y];
|
return i_cells[x][y];
|
||||||
}
|
}
|
||||||
|
|
||||||
GridType& operator()(uint32 x, uint32 y)
|
GridType& operator()(uint32 x, uint32 y)
|
||||||
{
|
{
|
||||||
ASSERT(x < N);
|
assert(x < N);
|
||||||
ASSERT(y < N);
|
assert(y < N);
|
||||||
return i_cells[x][y];
|
return i_cells[x][y];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -185,8 +187,8 @@ class MANGOS_DLL_DECL NGrid
|
||||||
|
|
||||||
GridType& getGridType(const uint32& x, const uint32& y)
|
GridType& getGridType(const uint32& x, const uint32& y)
|
||||||
{
|
{
|
||||||
ASSERT(x < N);
|
assert(x < N);
|
||||||
ASSERT(y < N);
|
assert(y < N);
|
||||||
return i_cells[x][y];
|
return i_cells[x][y];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
* types of object at the same time.
|
* types of object at the same time.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "Platform/Define.h"
|
#include "Platform/Define.h"
|
||||||
|
|
@ -89,7 +90,7 @@ class TypeUnorderedMapContainer
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ASSERT(i->second == obj && "Object with certain key already in but objects are different!");
|
assert(i->second == obj && "Object with certain key already in but objects are different!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ class Reference : public LinkedListElement
|
||||||
// Create new link
|
// Create new link
|
||||||
void link(TO* toObj, FROM* fromObj)
|
void link(TO* toObj, FROM* fromObj)
|
||||||
{
|
{
|
||||||
ASSERT(fromObj); // fromObj MUST not be NULL
|
assert(fromObj); // fromObj MUST not be NULL
|
||||||
if (isValid())
|
if (isValid())
|
||||||
unlink();
|
unlink();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2164,7 +2164,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList()
|
||||||
if(!criteria)
|
if(!criteria)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ASSERT(criteria->requiredType < ACHIEVEMENT_CRITERIA_TYPE_TOTAL && "Not updated ACHIEVEMENT_CRITERIA_TYPE_TOTAL?");
|
MANGOS_ASSERT(criteria->requiredType < ACHIEVEMENT_CRITERIA_TYPE_TOTAL && "Not updated ACHIEVEMENT_CRITERIA_TYPE_TOTAL?");
|
||||||
|
|
||||||
m_AchievementCriteriasByType[criteria->requiredType].push_back(criteria);
|
m_AchievementCriteriasByType[criteria->requiredType].push_back(criteria);
|
||||||
m_AchievementCriteriaListByAchievement[criteria->referredAchievement].push_back(criteria);
|
m_AchievementCriteriaListByAchievement[criteria->referredAchievement].push_back(criteria);
|
||||||
|
|
|
||||||
|
|
@ -16,14 +16,13 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Common.h"
|
#include "AuctionHouseMgr.h"
|
||||||
#include "Database/DatabaseEnv.h"
|
#include "Database/DatabaseEnv.h"
|
||||||
#include "Database/SQLStorage.h"
|
#include "Database/SQLStorage.h"
|
||||||
#include "DBCStores.h"
|
#include "DBCStores.h"
|
||||||
#include "ProgressBar.h"
|
#include "ProgressBar.h"
|
||||||
|
|
||||||
#include "AccountMgr.h"
|
#include "AccountMgr.h"
|
||||||
#include "AuctionHouseMgr.h"
|
|
||||||
#include "Item.h"
|
#include "Item.h"
|
||||||
#include "Language.h"
|
#include "Language.h"
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
|
|
@ -439,8 +438,8 @@ void AuctionHouseMgr::LoadAuctions()
|
||||||
|
|
||||||
void AuctionHouseMgr::AddAItem( Item* it )
|
void AuctionHouseMgr::AddAItem( Item* it )
|
||||||
{
|
{
|
||||||
ASSERT( it );
|
MANGOS_ASSERT( it );
|
||||||
ASSERT( mAitems.find(it->GetGUIDLow()) == mAitems.end());
|
MANGOS_ASSERT( mAitems.find(it->GetGUIDLow()) == mAitems.end());
|
||||||
mAitems[it->GetGUIDLow()] = it;
|
mAitems[it->GetGUIDLow()] = it;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,10 @@
|
||||||
#ifndef _AUCTION_HOUSE_MGR_H
|
#ifndef _AUCTION_HOUSE_MGR_H
|
||||||
#define _AUCTION_HOUSE_MGR_H
|
#define _AUCTION_HOUSE_MGR_H
|
||||||
|
|
||||||
|
#include "Common.h"
|
||||||
#include "SharedDefines.h"
|
#include "SharedDefines.h"
|
||||||
#include "Policies/Singleton.h"
|
#include "Policies/Singleton.h"
|
||||||
|
#include "DBCStructure.h"
|
||||||
|
|
||||||
class Item;
|
class Item;
|
||||||
class Player;
|
class Player;
|
||||||
|
|
@ -86,7 +88,7 @@ class AuctionHouseObject
|
||||||
|
|
||||||
void AddAuction(AuctionEntry *ah)
|
void AddAuction(AuctionEntry *ah)
|
||||||
{
|
{
|
||||||
ASSERT( ah );
|
MANGOS_ASSERT( ah );
|
||||||
AuctionsMap[ah->Id] = ah;
|
AuctionsMap[ah->Id] = ah;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Common.h"
|
|
||||||
#include "Bag.h"
|
#include "Bag.h"
|
||||||
#include "ObjectMgr.h"
|
#include "ObjectMgr.h"
|
||||||
#include "Database/DatabaseEnv.h"
|
#include "Database/DatabaseEnv.h"
|
||||||
|
|
@ -136,7 +135,7 @@ uint32 Bag::GetFreeSlots() const
|
||||||
|
|
||||||
void Bag::RemoveItem( uint8 slot, bool /*update*/ )
|
void Bag::RemoveItem( uint8 slot, bool /*update*/ )
|
||||||
{
|
{
|
||||||
ASSERT(slot < MAX_BAG_SIZE);
|
MANGOS_ASSERT(slot < MAX_BAG_SIZE);
|
||||||
|
|
||||||
if (m_bagslot[slot])
|
if (m_bagslot[slot])
|
||||||
m_bagslot[slot]->SetContainer(NULL);
|
m_bagslot[slot]->SetContainer(NULL);
|
||||||
|
|
@ -147,7 +146,7 @@ void Bag::RemoveItem( uint8 slot, bool /*update*/ )
|
||||||
|
|
||||||
void Bag::StoreItem( uint8 slot, Item *pItem, bool /*update*/ )
|
void Bag::StoreItem( uint8 slot, Item *pItem, bool /*update*/ )
|
||||||
{
|
{
|
||||||
ASSERT(slot < MAX_BAG_SIZE);
|
MANGOS_ASSERT(slot < MAX_BAG_SIZE);
|
||||||
|
|
||||||
if( pItem )
|
if( pItem )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,13 @@
|
||||||
#ifndef MANGOS_BAG_H
|
#ifndef MANGOS_BAG_H
|
||||||
#define MANGOS_BAG_H
|
#define MANGOS_BAG_H
|
||||||
|
|
||||||
// Maximum 36 Slots ( (CONTAINER_END - CONTAINER_FIELD_SLOT_1)/2
|
#include "Common.h"
|
||||||
#define MAX_BAG_SIZE 36 // 2.0.12
|
|
||||||
|
|
||||||
#include "ItemPrototype.h"
|
#include "ItemPrototype.h"
|
||||||
#include "Item.h"
|
#include "Item.h"
|
||||||
|
|
||||||
|
// Maximum 36 Slots ( (CONTAINER_END - CONTAINER_FIELD_SLOT_1)/2
|
||||||
|
#define MAX_BAG_SIZE 36 // 2.0.12
|
||||||
|
|
||||||
class Bag : public Item
|
class Bag : public Item
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -393,7 +393,7 @@ class BattleGround
|
||||||
void SetBgMap(BattleGroundMap* map) { m_Map = map; }
|
void SetBgMap(BattleGroundMap* map) { m_Map = map; }
|
||||||
BattleGroundMap* GetBgMap()
|
BattleGroundMap* GetBgMap()
|
||||||
{
|
{
|
||||||
ASSERT(m_Map);
|
MANGOS_ASSERT(m_Map);
|
||||||
return m_Map;
|
return m_Map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -252,7 +252,7 @@ int32 BattleGroundAB::_GetNodeNameId(uint8 node)
|
||||||
case BG_AB_NODE_LUMBER_MILL:return LANG_BG_AB_NODE_LUMBER_MILL;
|
case BG_AB_NODE_LUMBER_MILL:return LANG_BG_AB_NODE_LUMBER_MILL;
|
||||||
case BG_AB_NODE_GOLD_MINE: return LANG_BG_AB_NODE_GOLD_MINE;
|
case BG_AB_NODE_GOLD_MINE: return LANG_BG_AB_NODE_GOLD_MINE;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
MANGOS_ASSERT(0);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,8 @@
|
||||||
#ifndef __BATTLEGROUNDAB_H
|
#ifndef __BATTLEGROUNDAB_H
|
||||||
#define __BATTLEGROUNDAB_H
|
#define __BATTLEGROUNDAB_H
|
||||||
|
|
||||||
class BattleGround;
|
#include "Common.h"
|
||||||
|
#include "BattleGround.h"
|
||||||
|
|
||||||
enum BG_AB_WorldStates
|
enum BG_AB_WorldStates
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -210,7 +210,7 @@ void BattleGroundAV::HandleQuestComplete(uint32 questid, Player *player)
|
||||||
void BattleGroundAV::UpdateScore(BattleGroundTeamId team, int32 points )
|
void BattleGroundAV::UpdateScore(BattleGroundTeamId team, int32 points )
|
||||||
{
|
{
|
||||||
// note: to remove reinforcements points must be negative, for adding reinforcements points must be positive
|
// note: to remove reinforcements points must be negative, for adding reinforcements points must be positive
|
||||||
ASSERT( team == BG_TEAM_ALLIANCE || team == BG_TEAM_HORDE);
|
MANGOS_ASSERT( team == BG_TEAM_ALLIANCE || team == BG_TEAM_HORDE);
|
||||||
m_TeamScores[team] += points; // m_TeamScores is int32 - so no problems here
|
m_TeamScores[team] += points; // m_TeamScores is int32 - so no problems here
|
||||||
|
|
||||||
if (points < 0)
|
if (points < 0)
|
||||||
|
|
@ -449,7 +449,7 @@ void BattleGroundAV::ChangeMineOwner(uint8 mine, uint32 team)
|
||||||
// TODO implement quest 7122
|
// TODO implement quest 7122
|
||||||
// mine=0 northmine, mine=1 southmine
|
// mine=0 northmine, mine=1 southmine
|
||||||
// TODO changing the owner should result in setting respawntime to infinite for current creatures (they should fight the new ones), spawning new mine owners creatures and changing the chest - objects so that the current owning team can use them
|
// TODO changing the owner should result in setting respawntime to infinite for current creatures (they should fight the new ones), spawning new mine owners creatures and changing the chest - objects so that the current owning team can use them
|
||||||
ASSERT(mine == BG_AV_NORTH_MINE || mine == BG_AV_SOUTH_MINE);
|
MANGOS_ASSERT(mine == BG_AV_NORTH_MINE || mine == BG_AV_SOUTH_MINE);
|
||||||
if (m_Mine_Owner[mine] == int8(team))
|
if (m_Mine_Owner[mine] == int8(team))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -533,7 +533,7 @@ void BattleGroundAV::EventPlayerClickedOnFlag(Player *source, GameObject* target
|
||||||
|
|
||||||
void BattleGroundAV::EventPlayerDefendsPoint(Player* player, BG_AV_Nodes node)
|
void BattleGroundAV::EventPlayerDefendsPoint(Player* player, BG_AV_Nodes node)
|
||||||
{
|
{
|
||||||
ASSERT(GetStatus() == STATUS_IN_PROGRESS);
|
MANGOS_ASSERT(GetStatus() == STATUS_IN_PROGRESS);
|
||||||
|
|
||||||
uint32 team = GetTeamIndexByTeamId(player->GetTeam());
|
uint32 team = GetTeamIndexByTeamId(player->GetTeam());
|
||||||
|
|
||||||
|
|
@ -543,7 +543,7 @@ void BattleGroundAV::EventPlayerDefendsPoint(Player* player, BG_AV_Nodes node)
|
||||||
{
|
{
|
||||||
// until snowfall doesn't belong to anyone it is better handled in assault - code (best would be to have a special function
|
// until snowfall doesn't belong to anyone it is better handled in assault - code (best would be to have a special function
|
||||||
// for neutral nodes.. but doing this just for snowfall will be a bit to much i think
|
// for neutral nodes.. but doing this just for snowfall will be a bit to much i think
|
||||||
ASSERT(node == BG_AV_NODES_SNOWFALL_GRAVE); // currently the only neutral grave
|
MANGOS_ASSERT(node == BG_AV_NODES_SNOWFALL_GRAVE); // currently the only neutral grave
|
||||||
EventPlayerAssaultsPoint(player, node);
|
EventPlayerAssaultsPoint(player, node);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -659,9 +659,9 @@ void BattleGroundAV::UpdateNodeWorldState(BG_AV_Nodes node)
|
||||||
|
|
||||||
void BattleGroundAV::SendMineWorldStates(uint32 mine)
|
void BattleGroundAV::SendMineWorldStates(uint32 mine)
|
||||||
{
|
{
|
||||||
ASSERT(mine == BG_AV_NORTH_MINE || mine == BG_AV_SOUTH_MINE);
|
MANGOS_ASSERT(mine == BG_AV_NORTH_MINE || mine == BG_AV_SOUTH_MINE);
|
||||||
ASSERT(m_Mine_PrevOwner[mine] == BG_TEAM_ALLIANCE || m_Mine_PrevOwner[mine] == BG_TEAM_HORDE || m_Mine_PrevOwner[mine] == BG_AV_NEUTRAL_TEAM);
|
MANGOS_ASSERT(m_Mine_PrevOwner[mine] == BG_TEAM_ALLIANCE || m_Mine_PrevOwner[mine] == BG_TEAM_HORDE || m_Mine_PrevOwner[mine] == BG_AV_NEUTRAL_TEAM);
|
||||||
ASSERT(m_Mine_Owner[mine] == BG_TEAM_ALLIANCE || m_Mine_Owner[mine] == BG_TEAM_HORDE || m_Mine_Owner[mine] == BG_AV_NEUTRAL_TEAM);
|
MANGOS_ASSERT(m_Mine_Owner[mine] == BG_TEAM_ALLIANCE || m_Mine_Owner[mine] == BG_TEAM_HORDE || m_Mine_Owner[mine] == BG_AV_NEUTRAL_TEAM);
|
||||||
|
|
||||||
UpdateWorldState(BG_AV_MineWorldStates[mine][m_Mine_Owner[mine]], 1);
|
UpdateWorldState(BG_AV_MineWorldStates[mine][m_Mine_Owner[mine]], 1);
|
||||||
if (m_Mine_Owner[mine] != m_Mine_PrevOwner[mine])
|
if (m_Mine_Owner[mine] != m_Mine_PrevOwner[mine])
|
||||||
|
|
@ -725,11 +725,11 @@ uint32 BattleGroundAV::GetNodeName(BG_AV_Nodes node)
|
||||||
|
|
||||||
void BattleGroundAV::AssaultNode(BG_AV_Nodes node, uint32 team)
|
void BattleGroundAV::AssaultNode(BG_AV_Nodes node, uint32 team)
|
||||||
{
|
{
|
||||||
ASSERT(team < 3); // alliance:0, horde:1, neutral:2
|
MANGOS_ASSERT(team < 3); // alliance:0, horde:1, neutral:2
|
||||||
ASSERT(m_Nodes[node].TotalOwner != team);
|
MANGOS_ASSERT(m_Nodes[node].TotalOwner != team);
|
||||||
ASSERT(m_Nodes[node].Owner != team);
|
MANGOS_ASSERT(m_Nodes[node].Owner != team);
|
||||||
// only assault an assaulted node if no totalowner exists:
|
// only assault an assaulted node if no totalowner exists:
|
||||||
ASSERT(m_Nodes[node].State != POINT_ASSAULTED || m_Nodes[node].TotalOwner == BG_AV_NEUTRAL_TEAM);
|
MANGOS_ASSERT(m_Nodes[node].State != POINT_ASSAULTED || m_Nodes[node].TotalOwner == BG_AV_NEUTRAL_TEAM);
|
||||||
// the timer gets another time, if the previous owner was 0 == Neutral
|
// the timer gets another time, if the previous owner was 0 == Neutral
|
||||||
m_Nodes[node].Timer = (m_Nodes[node].PrevOwner != BG_AV_NEUTRAL_TEAM) ? BG_AV_CAPTIME : BG_AV_SNOWFALL_FIRSTCAP;
|
m_Nodes[node].Timer = (m_Nodes[node].PrevOwner != BG_AV_NEUTRAL_TEAM) ? BG_AV_CAPTIME : BG_AV_SNOWFALL_FIRSTCAP;
|
||||||
m_Nodes[node].PrevOwner = m_Nodes[node].Owner;
|
m_Nodes[node].PrevOwner = m_Nodes[node].Owner;
|
||||||
|
|
@ -740,7 +740,7 @@ void BattleGroundAV::AssaultNode(BG_AV_Nodes node, uint32 team)
|
||||||
|
|
||||||
void BattleGroundAV::DestroyNode(BG_AV_Nodes node)
|
void BattleGroundAV::DestroyNode(BG_AV_Nodes node)
|
||||||
{
|
{
|
||||||
ASSERT(m_Nodes[node].State == POINT_ASSAULTED);
|
MANGOS_ASSERT(m_Nodes[node].State == POINT_ASSAULTED);
|
||||||
|
|
||||||
m_Nodes[node].TotalOwner = m_Nodes[node].Owner;
|
m_Nodes[node].TotalOwner = m_Nodes[node].Owner;
|
||||||
m_Nodes[node].PrevOwner = m_Nodes[node].Owner;
|
m_Nodes[node].PrevOwner = m_Nodes[node].Owner;
|
||||||
|
|
@ -751,7 +751,7 @@ void BattleGroundAV::DestroyNode(BG_AV_Nodes node)
|
||||||
|
|
||||||
void BattleGroundAV::InitNode(BG_AV_Nodes node, uint32 team, bool tower)
|
void BattleGroundAV::InitNode(BG_AV_Nodes node, uint32 team, bool tower)
|
||||||
{
|
{
|
||||||
ASSERT(team < 3); // alliance:0, horde:1, neutral:2
|
MANGOS_ASSERT(team < 3); // alliance:0, horde:1, neutral:2
|
||||||
m_Nodes[node].TotalOwner = team;
|
m_Nodes[node].TotalOwner = team;
|
||||||
m_Nodes[node].Owner = team;
|
m_Nodes[node].Owner = team;
|
||||||
m_Nodes[node].PrevOwner = team;
|
m_Nodes[node].PrevOwner = team;
|
||||||
|
|
@ -767,10 +767,10 @@ void BattleGroundAV::InitNode(BG_AV_Nodes node, uint32 team, bool tower)
|
||||||
|
|
||||||
void BattleGroundAV::DefendNode(BG_AV_Nodes node, uint32 team)
|
void BattleGroundAV::DefendNode(BG_AV_Nodes node, uint32 team)
|
||||||
{
|
{
|
||||||
ASSERT(team < 3); // alliance:0, horde:1, neutral:2
|
MANGOS_ASSERT(team < 3); // alliance:0, horde:1, neutral:2
|
||||||
ASSERT(m_Nodes[node].TotalOwner == team);
|
MANGOS_ASSERT(m_Nodes[node].TotalOwner == team);
|
||||||
ASSERT(m_Nodes[node].Owner != team);
|
MANGOS_ASSERT(m_Nodes[node].Owner != team);
|
||||||
ASSERT(m_Nodes[node].State != POINT_CONTROLLED);
|
MANGOS_ASSERT(m_Nodes[node].State != POINT_CONTROLLED);
|
||||||
m_Nodes[node].PrevOwner = m_Nodes[node].Owner;
|
m_Nodes[node].PrevOwner = m_Nodes[node].Owner;
|
||||||
m_Nodes[node].Owner = team;
|
m_Nodes[node].Owner = team;
|
||||||
m_Nodes[node].PrevState = m_Nodes[node].State;
|
m_Nodes[node].PrevState = m_Nodes[node].State;
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,8 @@
|
||||||
#ifndef __BATTLEGROUNDAV_H
|
#ifndef __BATTLEGROUNDAV_H
|
||||||
#define __BATTLEGROUNDAV_H
|
#define __BATTLEGROUNDAV_H
|
||||||
|
|
||||||
class BattleGround;
|
#include "Common.h"
|
||||||
|
#include "BattleGround.h"
|
||||||
|
|
||||||
#define BG_AV_MAX_NODE_DISTANCE 25 // distance in which players are still counted in range of a banner (for alliance towers this is calculated from the center of the tower)
|
#define BG_AV_MAX_NODE_DISTANCE 25 // distance in which players are still counted in range of a banner (for alliance towers this is calculated from the center of the tower)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,21 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
#include "Camera.h"
|
#include "Camera.h"
|
||||||
#include "GridNotifiersImpl.h"
|
#include "GridNotifiersImpl.h"
|
||||||
#include "CellImpl.h"
|
#include "CellImpl.h"
|
||||||
|
|
@ -13,7 +31,7 @@ Camera::Camera(Player* pl) : m_owner(*pl), m_source(pl)
|
||||||
Camera::~Camera()
|
Camera::~Camera()
|
||||||
{
|
{
|
||||||
// view of camera should be already reseted to owner (RemoveFromWorld -> Event_RemovedFromWorld -> ResetView)
|
// view of camera should be already reseted to owner (RemoveFromWorld -> Event_RemovedFromWorld -> ResetView)
|
||||||
ASSERT(m_source == &m_owner);
|
MANGOS_ASSERT(m_source == &m_owner);
|
||||||
|
|
||||||
// for symmetry with constructor and way to make viewpoint's list empty
|
// for symmetry with constructor and way to make viewpoint's list empty
|
||||||
m_source->GetViewPoint().Detach(this);
|
m_source->GetViewPoint().Detach(this);
|
||||||
|
|
@ -37,7 +55,7 @@ void Camera::UpdateForCurrentViewPoint()
|
||||||
|
|
||||||
void Camera::SetView(WorldObject *obj)
|
void Camera::SetView(WorldObject *obj)
|
||||||
{
|
{
|
||||||
ASSERT(obj);
|
MANGOS_ASSERT(obj);
|
||||||
|
|
||||||
if (m_source == obj)
|
if (m_source == obj)
|
||||||
return;
|
return;
|
||||||
|
|
@ -83,7 +101,7 @@ void Camera::ResetView()
|
||||||
void Camera::Event_AddedToWorld()
|
void Camera::Event_AddedToWorld()
|
||||||
{
|
{
|
||||||
GridType* grid = m_source->GetViewPoint().m_grid;
|
GridType* grid = m_source->GetViewPoint().m_grid;
|
||||||
ASSERT(grid);
|
MANGOS_ASSERT(grid);
|
||||||
grid->AddWorldObject(this);
|
grid->AddWorldObject(this);
|
||||||
|
|
||||||
UpdateVisibilityForOwner();
|
UpdateVisibilityForOwner();
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,25 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef MANGOSSERVER_CAMERA_H
|
#ifndef MANGOSSERVER_CAMERA_H
|
||||||
#define MANGOSSERVER_CAMERA_H
|
#define MANGOSSERVER_CAMERA_H
|
||||||
|
|
||||||
|
#include "Common.h"
|
||||||
#include "GridDefines.h"
|
#include "GridDefines.h"
|
||||||
|
|
||||||
class ViewPoint;
|
class ViewPoint;
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
#ifndef MANGOS_CELLIMPL_H
|
#ifndef MANGOS_CELLIMPL_H
|
||||||
#define MANGOS_CELLIMPL_H
|
#define MANGOS_CELLIMPL_H
|
||||||
|
|
||||||
|
#include "Common.h"
|
||||||
#include "Cell.h"
|
#include "Cell.h"
|
||||||
#include "Map.h"
|
#include "Map.h"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
@ -108,7 +109,7 @@ Cell::Visit(const CellPair &standing_cell, TypeContainerVisitor<T, CONTAINER> &v
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
ASSERT( false );
|
MANGOS_ASSERT( false );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Chat.h"
|
||||||
#include "Language.h"
|
#include "Language.h"
|
||||||
#include "Database/DatabaseEnv.h"
|
#include "Database/DatabaseEnv.h"
|
||||||
#include "WorldPacket.h"
|
#include "WorldPacket.h"
|
||||||
|
|
@ -28,7 +28,6 @@
|
||||||
#include "ObjectGuid.h"
|
#include "ObjectGuid.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
#include "UpdateMask.h"
|
#include "UpdateMask.h"
|
||||||
#include "Chat.h"
|
|
||||||
#include "GridNotifiersImpl.h"
|
#include "GridNotifiersImpl.h"
|
||||||
#include "CellImpl.h"
|
#include "CellImpl.h"
|
||||||
#include "AccountMgr.h"
|
#include "AccountMgr.h"
|
||||||
|
|
@ -1255,8 +1254,8 @@ bool ChatHandler::SetDataForCommandInTable(ChatCommand *commandTable, const char
|
||||||
|
|
||||||
bool ChatHandler::ParseCommands(const char* text)
|
bool ChatHandler::ParseCommands(const char* text)
|
||||||
{
|
{
|
||||||
ASSERT(text);
|
MANGOS_ASSERT(text);
|
||||||
ASSERT(*text);
|
MANGOS_ASSERT(*text);
|
||||||
|
|
||||||
//if(m_session->GetSecurity() == SEC_PLAYER)
|
//if(m_session->GetSecurity() == SEC_PLAYER)
|
||||||
// return false;
|
// return false;
|
||||||
|
|
@ -1995,7 +1994,7 @@ void ChatHandler::FillMessageData( WorldPacket *data, WorldSession* session, uin
|
||||||
|
|
||||||
if (type == CHAT_MSG_CHANNEL)
|
if (type == CHAT_MSG_CHANNEL)
|
||||||
{
|
{
|
||||||
ASSERT(channelName);
|
MANGOS_ASSERT(channelName);
|
||||||
*data << channelName;
|
*data << channelName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
#include "ObjectGuid.h"
|
#include "ObjectGuid.h"
|
||||||
|
|
||||||
struct AchievementEntry;
|
struct AchievementEntry;
|
||||||
|
struct AchievementCriteriaEntry;
|
||||||
struct AreaTrigger;
|
struct AreaTrigger;
|
||||||
struct AreaTriggerEntry;
|
struct AreaTriggerEntry;
|
||||||
struct FactionEntry;
|
struct FactionEntry;
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,10 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ConfusedMovementGenerator.h"
|
||||||
#include "Creature.h"
|
#include "Creature.h"
|
||||||
#include "MapManager.h"
|
#include "MapManager.h"
|
||||||
#include "Opcodes.h"
|
#include "Opcodes.h"
|
||||||
#include "ConfusedMovementGenerator.h"
|
|
||||||
#include "DestinationHolderImp.h"
|
#include "DestinationHolderImp.h"
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
|
|
@ -140,7 +140,7 @@ bool ConfusedMovementGenerator<T>::Update(T &unit, const uint32 &diff)
|
||||||
{
|
{
|
||||||
// start moving
|
// start moving
|
||||||
unit.addUnitState(UNIT_STAT_CONFUSED_MOVE);
|
unit.addUnitState(UNIT_STAT_CONFUSED_MOVE);
|
||||||
ASSERT( i_nextMove <= MAX_CONF_WAYPOINTS );
|
MANGOS_ASSERT( i_nextMove <= MAX_CONF_WAYPOINTS );
|
||||||
const float x = i_waypoints[i_nextMove][0];
|
const float x = i_waypoints[i_nextMove][0];
|
||||||
const float y = i_waypoints[i_nextMove][1];
|
const float y = i_waypoints[i_nextMove][1];
|
||||||
const float z = i_waypoints[i_nextMove][2];
|
const float z = i_waypoints[i_nextMove][2];
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Common.h"
|
|
||||||
#include "Corpse.h"
|
#include "Corpse.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
#include "UpdateMask.h"
|
#include "UpdateMask.h"
|
||||||
|
|
@ -74,7 +73,7 @@ bool Corpse::Create( uint32 guidlow )
|
||||||
|
|
||||||
bool Corpse::Create( uint32 guidlow, Player *owner)
|
bool Corpse::Create( uint32 guidlow, Player *owner)
|
||||||
{
|
{
|
||||||
ASSERT(owner);
|
MANGOS_ASSERT(owner);
|
||||||
|
|
||||||
WorldObject::_Create(guidlow, HIGHGUID_CORPSE, owner->GetPhaseMask());
|
WorldObject::_Create(guidlow, HIGHGUID_CORPSE, owner->GetPhaseMask());
|
||||||
Relocate(owner->GetPositionX(), owner->GetPositionY(), owner->GetPositionZ(), owner->GetOrientation());
|
Relocate(owner->GetPositionX(), owner->GetPositionY(), owner->GetPositionZ(), owner->GetOrientation());
|
||||||
|
|
@ -101,7 +100,7 @@ bool Corpse::Create( uint32 guidlow, Player *owner)
|
||||||
void Corpse::SaveToDB()
|
void Corpse::SaveToDB()
|
||||||
{
|
{
|
||||||
// bones should not be saved to DB (would be deleted on startup anyway)
|
// bones should not be saved to DB (would be deleted on startup anyway)
|
||||||
ASSERT(GetType() != CORPSE_BONES);
|
MANGOS_ASSERT(GetType() != CORPSE_BONES);
|
||||||
|
|
||||||
// prevent DB data inconsistence problems and duplicates
|
// prevent DB data inconsistence problems and duplicates
|
||||||
CharacterDatabase.BeginTransaction();
|
CharacterDatabase.BeginTransaction();
|
||||||
|
|
@ -126,7 +125,7 @@ void Corpse::SaveToDB()
|
||||||
|
|
||||||
void Corpse::DeleteBonesFromWorld()
|
void Corpse::DeleteBonesFromWorld()
|
||||||
{
|
{
|
||||||
ASSERT(GetType() == CORPSE_BONES);
|
MANGOS_ASSERT(GetType() == CORPSE_BONES);
|
||||||
Corpse* corpse = GetMap()->GetCorpse(GetGUID());
|
Corpse* corpse = GetMap()->GetCorpse(GetGUID());
|
||||||
|
|
||||||
if (!corpse)
|
if (!corpse)
|
||||||
|
|
@ -141,7 +140,7 @@ void Corpse::DeleteBonesFromWorld()
|
||||||
void Corpse::DeleteFromDB()
|
void Corpse::DeleteFromDB()
|
||||||
{
|
{
|
||||||
// bones should not be saved to DB (would be deleted on startup anyway)
|
// bones should not be saved to DB (would be deleted on startup anyway)
|
||||||
ASSERT(GetType() != CORPSE_BONES);
|
MANGOS_ASSERT(GetType() != CORPSE_BONES);
|
||||||
|
|
||||||
// all corpses (not bones)
|
// all corpses (not bones)
|
||||||
CharacterDatabase.PExecute("DELETE FROM corpse WHERE player = '%d' AND corpse_type <> '0'", GUID_LOPART(GetOwnerGUID()));
|
CharacterDatabase.PExecute("DELETE FROM corpse WHERE player = '%d' AND corpse_type <> '0'", GUID_LOPART(GetOwnerGUID()));
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
#ifndef MANGOSSERVER_CORPSE_H
|
#ifndef MANGOSSERVER_CORPSE_H
|
||||||
#define MANGOSSERVER_CORPSE_H
|
#define MANGOSSERVER_CORPSE_H
|
||||||
|
|
||||||
|
#include "Common.h"
|
||||||
#include "Object.h"
|
#include "Object.h"
|
||||||
#include "Database/DatabaseEnv.h"
|
#include "Database/DatabaseEnv.h"
|
||||||
#include "GridDefines.h"
|
#include "GridDefines.h"
|
||||||
|
|
|
||||||
|
|
@ -16,14 +16,13 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Creature.h"
|
||||||
#include "Database/DatabaseEnv.h"
|
#include "Database/DatabaseEnv.h"
|
||||||
#include "WorldPacket.h"
|
#include "WorldPacket.h"
|
||||||
#include "World.h"
|
#include "World.h"
|
||||||
#include "ObjectMgr.h"
|
#include "ObjectMgr.h"
|
||||||
#include "ObjectGuid.h"
|
#include "ObjectGuid.h"
|
||||||
#include "SpellMgr.h"
|
#include "SpellMgr.h"
|
||||||
#include "Creature.h"
|
|
||||||
#include "QuestDef.h"
|
#include "QuestDef.h"
|
||||||
#include "GossipDef.h"
|
#include "GossipDef.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
|
|
@ -686,7 +685,7 @@ bool Creature::AIM_Initialize()
|
||||||
|
|
||||||
bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 team, const CreatureData *data)
|
bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 team, const CreatureData *data)
|
||||||
{
|
{
|
||||||
ASSERT(map);
|
MANGOS_ASSERT(map);
|
||||||
SetMap(map);
|
SetMap(map);
|
||||||
SetPhaseMask(phaseMask,false);
|
SetPhaseMask(phaseMask,false);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,9 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "CreatureAISelector.h"
|
||||||
#include "Creature.h"
|
#include "Creature.h"
|
||||||
#include "CreatureAIImpl.h"
|
#include "CreatureAIImpl.h"
|
||||||
#include "CreatureAISelector.h"
|
|
||||||
#include "NullCreatureAI.h"
|
#include "NullCreatureAI.h"
|
||||||
#include "Policies/SingletonImp.h"
|
#include "Policies/SingletonImp.h"
|
||||||
#include "MovementGenerator.h"
|
#include "MovementGenerator.h"
|
||||||
|
|
@ -69,7 +69,7 @@ namespace FactorySelector
|
||||||
{
|
{
|
||||||
const CreatureAICreator *factory = iter->second;
|
const CreatureAICreator *factory = iter->second;
|
||||||
const SelectableAI *p = dynamic_cast<const SelectableAI *>(factory);
|
const SelectableAI *p = dynamic_cast<const SelectableAI *>(factory);
|
||||||
ASSERT( p != NULL );
|
MANGOS_ASSERT( p != NULL );
|
||||||
int val = p->Permit(creature);
|
int val = p->Permit(creature);
|
||||||
if( val > best_val )
|
if( val > best_val )
|
||||||
{
|
{
|
||||||
|
|
@ -89,7 +89,7 @@ namespace FactorySelector
|
||||||
MovementGenerator* selectMovementGenerator(Creature *creature)
|
MovementGenerator* selectMovementGenerator(Creature *creature)
|
||||||
{
|
{
|
||||||
MovementGeneratorRegistry &mv_registry(MovementGeneratorRepository::Instance());
|
MovementGeneratorRegistry &mv_registry(MovementGeneratorRepository::Instance());
|
||||||
ASSERT( creature->GetCreatureInfo() != NULL );
|
MANGOS_ASSERT( creature->GetCreatureInfo() != NULL );
|
||||||
MovementGeneratorCreator const * mv_factory = mv_registry.GetRegistryItem(
|
MovementGeneratorCreator const * mv_factory = mv_registry.GetRegistryItem(
|
||||||
IS_PLAYER_GUID(creature->GetOwnerGUID()) ? FOLLOW_MOTION_TYPE : creature->GetDefaultMovementType());
|
IS_PLAYER_GUID(creature->GetOwnerGUID()) ? FOLLOW_MOTION_TYPE : creature->GetDefaultMovementType());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -281,7 +281,7 @@ template<class T>
|
||||||
inline void LoadDBC(LocalData& localeData,barGoLink& bar, StoreProblemList& errlist, DBCStorage<T>& storage, const std::string& dbc_path, const std::string& filename)
|
inline void LoadDBC(LocalData& localeData,barGoLink& bar, StoreProblemList& errlist, DBCStorage<T>& storage, const std::string& dbc_path, const std::string& filename)
|
||||||
{
|
{
|
||||||
// compatibility format and C++ structure sizes
|
// compatibility format and C++ structure sizes
|
||||||
ASSERT(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T) || LoadDBC_assert_print(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()),sizeof(T),filename));
|
MANGOS_ASSERT(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T) || LoadDBC_assert_print(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()),sizeof(T),filename));
|
||||||
|
|
||||||
std::string dbc_filename = dbc_path + filename;
|
std::string dbc_filename = dbc_path + filename;
|
||||||
if(storage.Load(dbc_filename.c_str()))
|
if(storage.Load(dbc_filename.c_str()))
|
||||||
|
|
@ -463,7 +463,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||||
for(uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i)
|
for(uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i)
|
||||||
if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i))
|
if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i))
|
||||||
if (entry->bracketId > MAX_BATTLEGROUND_BRACKETS)
|
if (entry->bracketId > MAX_BATTLEGROUND_BRACKETS)
|
||||||
ASSERT(false && "Need update MAX_BATTLEGROUND_BRACKETS by DBC data");
|
MANGOS_ASSERT(false && "Need update MAX_BATTLEGROUND_BRACKETS by DBC data");
|
||||||
|
|
||||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sRandomPropertiesPointsStore, dbcPath,"RandPropPoints.dbc");
|
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sRandomPropertiesPointsStore, dbcPath,"RandPropPoints.dbc");
|
||||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sScalingStatDistributionStore, dbcPath,"ScalingStatDistribution.dbc");
|
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sScalingStatDistributionStore, dbcPath,"ScalingStatDistribution.dbc");
|
||||||
|
|
@ -925,7 +925,7 @@ bool IsPointInAreaTriggerZone(AreaTriggerEntry const* atEntry, uint32 mapid, flo
|
||||||
// rotate the players position instead of rotating the whole cube, that way we can make a simplified
|
// rotate the players position instead of rotating the whole cube, that way we can make a simplified
|
||||||
// is-in-cube check and we have to calculate only one point instead of 4
|
// is-in-cube check and we have to calculate only one point instead of 4
|
||||||
|
|
||||||
// 2PI = 360°, keep in mind that ingame orientation is counter-clockwise
|
// 2PI = 360 | ||||||