diff options
-rw-r--r-- | src/game/Map.cpp | 18 | ||||
-rw-r--r-- | src/game/Spell.cpp | 16 | ||||
-rw-r--r-- | src/game/World.cpp | 15 | ||||
-rw-r--r-- | src/game/World.h | 2 | ||||
-rw-r--r-- | src/trinitycore/trinitycore.conf.dist | 6 |
5 files changed, 24 insertions, 33 deletions
diff --git a/src/game/Map.cpp b/src/game/Map.cpp index 81dac274b1c..2ecb350beb5 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -656,12 +656,22 @@ void Map::Update(const uint32 &t_diff) unit->m_Notified = true; if(!unit->IsInWorld()) continue; - CellPair val = Trinity::ComputeCellPair(unit->GetPositionX(), unit->GetPositionY()); - Cell cell(val); + //CellPair val = Trinity::ComputeCellPair(unit->GetPositionX(), unit->GetPositionY()); + //Cell cell(val); + //if(unit->GetTypeId() == TYPEID_PLAYER) + // PlayerRelocationNotify((Player*)unit, cell, val); + //else + // CreatureRelocationNotify((Creature*)unit, cell, val); if(unit->GetTypeId() == TYPEID_PLAYER) - PlayerRelocationNotify((Player*)unit, cell, val); + { + Trinity::PlayerRelocationNotifier notifier(*((Player*)unit)); + VisitAll(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance(), notifier); + } else - CreatureRelocationNotify((Creature*)unit, cell, val); + { + Trinity::CreatureRelocationNotifier notifier(*((Creature*)unit)); + VisitAll(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance(), notifier); + } } for(std::vector<uint64>::iterator iter = i_unitsToNotify.begin(); iter != i_unitsToNotify.end(); ++iter) { diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 2ea644f7652..15b4ae78d5e 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -587,22 +587,6 @@ void Spell::FillTargetMap() if(IsChanneledSpell(m_spellInfo) && !tmpUnitMap.empty()) m_needAliveTargetMask |= (1<<i); - /*if(m_caster->GetTypeId() == TYPEID_PLAYER) - { - Player *me = (Player*)m_caster; - for (std::list<Unit*>::const_iterator itr = tmpUnitMap.begin(); itr != tmpUnitMap.end(); ++itr) - { - Unit *owner = (*itr)->GetOwner(); - Unit *u = owner ? owner : (*itr); - if(u!=m_caster && u->IsPvP() && (!me->duel || me->duel->opponent != u)) - { - me->UpdatePvP(true); - me->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT); - break; - } - } - }*/ - for (std::list<Unit*>::iterator itr = tmpUnitMap.begin() ; itr != tmpUnitMap.end();) { if(!CheckTarget(*itr, i, false )) diff --git a/src/game/World.cpp b/src/game/World.cpp index 897fe2031d5..4e9a9a7d41b 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -904,6 +904,7 @@ void World::LoadConfigSettings(bool reload) sLog.outError("Visibility. Distance .Creature can't be greater %f",MAX_VISIBILITY_DISTANCE - m_VisibleUnitGreyDistance); m_MaxVisibleDistanceForCreature = MAX_VISIBILITY_DISTANCE-m_VisibleUnitGreyDistance; } + m_MaxVisibleDistanceForPlayer = sConfig.GetFloatDefault("Visibility.Distance.Player", DEFAULT_VISIBILITY_DISTANCE); if(m_MaxVisibleDistanceForPlayer < 45*sWorld.getRate(RATE_CREATURE_AGGRO)) { @@ -915,6 +916,8 @@ void World::LoadConfigSettings(bool reload) sLog.outError("Visibility.Distance.Player can't be greater %f",MAX_VISIBILITY_DISTANCE - m_VisibleUnitGreyDistance); m_MaxVisibleDistanceForPlayer = MAX_VISIBILITY_DISTANCE - m_VisibleUnitGreyDistance; } + m_MaxVisibleDistance = std::max(m_MaxVisibleDistanceForPlayer, m_MaxVisibleDistanceForCreature); + m_MaxVisibleDistanceForObject = sConfig.GetFloatDefault("Visibility.Distance.Gameobject", DEFAULT_VISIBILITY_DISTANCE); if(m_MaxVisibleDistanceForObject < INTERACTION_DISTANCE) { @@ -926,12 +929,17 @@ void World::LoadConfigSettings(bool reload) sLog.outError("Visibility.Distance.Object can't be greater %f",MAX_VISIBILITY_DISTANCE-m_VisibleObjectGreyDistance); m_MaxVisibleDistanceForObject = MAX_VISIBILITY_DISTANCE - m_VisibleObjectGreyDistance; } + if(m_MaxVisibleDistance < m_MaxVisibleDistanceForObject) + m_MaxVisibleDistance = m_MaxVisibleDistanceForObject; + m_MaxVisibleDistanceInFlight = sConfig.GetFloatDefault("Visibility.Distance.InFlight", DEFAULT_VISIBILITY_DISTANCE); if(m_MaxVisibleDistanceInFlight + m_VisibleObjectGreyDistance > MAX_VISIBILITY_DISTANCE) { sLog.outError("Visibility.Distance.InFlight can't be greater %f",MAX_VISIBILITY_DISTANCE-m_VisibleObjectGreyDistance); m_MaxVisibleDistanceInFlight = MAX_VISIBILITY_DISTANCE - m_VisibleObjectGreyDistance; } + if(m_MaxVisibleDistance < m_MaxVisibleDistanceInFlight) + m_MaxVisibleDistance = m_MaxVisibleDistanceInFlight; ///- Read the "Data" directory from the config file std::string dataPath = sConfig.GetStringDefault("DataDir","./"); @@ -980,13 +988,6 @@ void World::LoadConfigSettings(bool reload) m_configs[CONFIG_PVP_TOKEN_COUNT] = 1; m_configs[CONFIG_NO_RESET_TALENT_COST] = sConfig.GetBoolDefault("NoResetTalentsCost", false); - m_configs[CONFIG_ARENA_MAX_RATING_DIFFERENCE] = sConfig.GetIntDefault("Arena.MaxRatingDifference", 0); - m_configs[CONFIG_ARENA_RATING_DISCARD_TIMER] = sConfig.GetIntDefault("Arena.RatingDiscardTimer",300000); - m_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS] = sConfig.GetBoolDefault("Arena.AutoDistributePoints", false); - m_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS] = sConfig.GetIntDefault("Arena.AutoDistributeInterval", 7); - - m_configs[CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER] = sConfig.GetIntDefault("BattleGround.PrematureFinishTimer", 0); - std::string forbiddenmaps = sConfig.GetStringDefault("ForbiddenMaps", ""); char * forbiddenMaps = new char[forbiddenmaps.length() + 1]; forbiddenMaps[forbiddenmaps.length()] = 0; diff --git a/src/game/World.h b/src/game/World.h index 903304e25ec..2edbf7669f9 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -474,6 +474,7 @@ class World bool IsAllowedMap(uint32 mapid) { return m_forbiddenMapIds.count(mapid) == 0 ;} // for max speed access + static float GetMaxVisibleDistance() { return m_MaxVisibleDistance; } static float GetMaxVisibleDistanceForCreature() { return m_MaxVisibleDistanceForCreature; } static float GetMaxVisibleDistanceForPlayer() { return m_MaxVisibleDistanceForPlayer; } static float GetMaxVisibleDistanceForObject() { return m_MaxVisibleDistanceForObject; } @@ -542,6 +543,7 @@ class World std::set<uint32> m_forbiddenMapIds; // for max speed access + static float m_MaxVisibleDistance; static float m_MaxVisibleDistanceForCreature; static float m_MaxVisibleDistanceForPlayer; static float m_MaxVisibleDistanceForObject; diff --git a/src/trinitycore/trinitycore.conf.dist b/src/trinitycore/trinitycore.conf.dist index 214437cd60a..ba5f2de372f 100644 --- a/src/trinitycore/trinitycore.conf.dist +++ b/src/trinitycore/trinitycore.conf.dist @@ -1215,11 +1215,6 @@ Ra.Secure = 1 # PlayerStart.MapsExplored # Players will start with all maps explored if enabled # -# PlayerInstantLogout -# Enable or disable instant logout for all players (NOT in combat/while dueling/while falling) -# Default: 0 - off -# 1 - on -# # MusicInBattleground # If enabled, "L70ETC - Power of the horde" will be played when BG starts ;) # @@ -1261,7 +1256,6 @@ Ra.Secure = 1 PlayerStart.AllReputation = 0 PlayerStart.AllSpells = 0 PlayerStart.MapsExplored = 0 -PlayerInstantLogout = 0 MusicInBattleground = 0 HonorPointsAfterDuel = 0 AlwaysMaxWeaponSkill = 0 |