Remove a possible NaN-value in WorldObject::HasInArc (thanks to arrai)

+ do some hack'n'slash-work on the CMakeLists with my trusted axe ( I just LOVE being a viking - I get to wield an axe for free!)

--HG--
branch : trunk
This commit is contained in:
click
2010-06-24 17:32:50 +02:00
parent 35aa050db8
commit 0b2dad9c97
8 changed files with 19 additions and 234 deletions
-159
View File
@@ -18,78 +18,41 @@ endif()
# Create game-libary
set(game_STAT_SRCS
Accounts/AccountMgr.cpp
Accounts/AccountMgr.h
Achievements/AchievementMgr.h
Achievements/AchievementMgr.cpp
Addons/AddonMgr.cpp
Addons/AddonMgr.h
AI/CoreAI/CombatAI.cpp
AI/CoreAI/CombatAI.h
AI/CoreAI/GuardAI.cpp
AI/CoreAI/GuardAI.h
AI/CoreAI/PassiveAI.cpp
AI/CoreAI/PassiveAI.h
AI/CoreAI/PetAI.cpp
AI/CoreAI/PetAI.h
AI/CoreAI/ReactorAI.cpp
AI/CoreAI/ReactorAI.h
AI/CoreAI/TotemAI.cpp
AI/CoreAI/TotemAI.h
AI/CoreAI/UnitAI.cpp
AI/CoreAI/UnitAI.h
AI/EventAI/CreatureEventAI.cpp
AI/EventAI/CreatureEventAIMgr.cpp
AI/ScriptedAI/ScriptedSmartAI.cpp
AI/ScriptedAI/ScriptedSmartAI.h
AI/CreatureAIFactory.h
AI/CreatureAIImpl.h
AI/CreatureAIRegistry.cpp
AI/CreatureAIRegistry.h
AI/CreatureAISelector.cpp
AI/CreatureAISelector.h
AI/CreatureAI.cpp
AI/CreatureAI.h
AuctionHouse/AuctionHouseMgr.cpp
AuctionHouse/AuctionHouseMgr.h
AuctionHouse/AuctionHouseBot/AuctionHouseBot.cpp
AuctionHouse/AuctionHouseBot/AuctionHouseBot.h
BattleGrounds/ArenaTeam.cpp
BattleGrounds/ArenaTeam.h
BattleGrounds/Zones/BattleGroundAA.cpp
BattleGrounds/Zones/BattleGroundAA.h
BattleGrounds/Zones/BattleGroundAB.cpp
BattleGrounds/Zones/BattleGroundAB.h
BattleGrounds/Zones/BattleGroundRB.cpp
BattleGrounds/Zones/BattleGroundRB.h
BattleGrounds/Zones/BattleGroundAV.cpp
BattleGrounds/Zones/BattleGroundAV.h
BattleGrounds/Zones/BattleGroundBE.cpp
BattleGrounds/Zones/BattleGroundBE.h
BattleGrounds/Zones/BattleGroundDS.cpp
BattleGrounds/Zones/BattleGroundDS.h
BattleGrounds/Zones/BattleGroundEY.cpp
BattleGrounds/Zones/BattleGroundEY.h
BattleGrounds/Zones/BattleGroundIC.cpp
BattleGrounds/Zones/BattleGroundIC.h
BattleGrounds/Zones/BattleGroundNA.cpp
BattleGrounds/Zones/BattleGroundNA.h
BattleGrounds/Zones/BattleGroundRL.cpp
BattleGrounds/Zones/BattleGroundRL.h
BattleGrounds/Zones/BattleGroundRV.cpp
BattleGrounds/Zones/BattleGroundRV.h
BattleGrounds/Zones/BattleGroundSA.cpp
BattleGrounds/Zones/BattleGroundSA.h
BattleGrounds/Zones/BattleGroundWS.cpp
BattleGrounds/Zones/BattleGroundWS.h
BattleGrounds/BattleGround.cpp
BattleGrounds/BattleGround.h
BattleGrounds/BattleGroundMgr.cpp
BattleGrounds/BattleGroundMgr.h
Calendar/Calendar.cpp
Calendar/Calendar.h
Chat/Channels/Channel.cpp
Chat/Channels/Channel.h
Chat/Channels/ChannelMgr.h
Chat/Channels/ChannelMgr.cpp
Chat/Commands/Debugcmds.cpp
Chat/Commands/Level0.cpp
@@ -97,176 +60,78 @@ set(game_STAT_SRCS
Chat/Commands/Level2.cpp
Chat/Commands/Level3.cpp
Chat/Chat.cpp
Chat/Chat.h
Combat/HostileRefManager.cpp
Combat/HostileRefManager.h
Combat/ThreatManager.cpp
Combat/ThreatManager.h
Combat/UnitEvents.h
Conditions/ConditionMgr.cpp
Conditions/ConditionMgr.h
DataStores/DBCEnums.h
DataStores/DBCStores.cpp
DataStores/DBCStores.h
DataStores/DBCStructure.h
DataStores/DBCfmt.h
DungeonFinding/LFG.h
DungeonFinding/LFGMgr.cpp
DungeonFinding/LFGMgr.h
Entities/Corpse/Corpse.cpp
Entities/Corpse/Corpse.h
Entities/Creature/Creature.cpp
Entities/Creature/Creature.h
Entities/Creature/CreatureGroups.cpp
Entities/Creature/CreatureGroups.h
Entities/Creature/GossipDef.cpp
Entities/Creature/GossipDef.h
Entities/Creature/TemporarySummon.cpp
Entities/Creature/TemporarySummon.h
Entities/DynamicObject/DynamicObject.cpp
Entities/DynamicObject/DynamicObject.h
Entities/GameObject/GameObject.cpp
Entities/GameObject/GameObject.h
Entities/Item/Container/Bag.cpp
Entities/Item/Container/Bag.h
Entities/Item/Item.cpp
Entities/Item/Item.h
Entities/Item/ItemEnchantmentMgr.cpp
Entities/Item/ItemEnchantmentMgr.h
Entities/Item/ItemPrototype.h
Entities/Object/Updates/UpdateData.cpp
Entities/Object/Updates/UpdateData.h
Entities/Object/Updates/UpdateFields.h
Entities/Object/Updates/UpdateMask.h
Entities/Object/ObjectDefines.h
Entities/Object/Object.cpp
Entities/Object/Object.h
Entities/Object/ObjectPosSelector.cpp
Entities/Object/ObjectPosSelector.h
Entities/Pet/Pet.cpp
Entities/Pet/Pet.h
Entities/Player/Player.cpp
Entities/Player/Player.h
Entities/Player/SocialMgr.cpp
Entities/Player/SocialMgr.h
Entities/Unit/StatSystem.cpp
Entities/Unit/Unit.cpp
Entities/Unit/Unit.h
Entities/Totem/Totem.cpp
Entities/Totem/Totem.h
Entities/Transport/Transport.cpp
Entities/Transport/Transport.h
Entities/Vehicle/Vehicle.cpp
Entities/Vehicle/Vehicle.h
Events/GameEventMgr.cpp
Events/GameEventMgr.h
Globals/GlobalEvents.cpp
Globals/GlobalEvents.h
Globals/ObjectAccessor.cpp
Globals/ObjectAccessor.h
Globals/ObjectMgr.cpp
Globals/ObjectMgr.h
Grids/Cells/Cell.h
Grids/Cells/CellImpl.h
Grids/Notifiers/GridNotifiers.cpp
Grids/Notifiers/GridNotifiers.h
Grids/Notifiers/GridNotifiersImpl.h
Grids/GridDefines.h
Grids/GridStates.cpp
Grids/GridStates.h
Grids/ObjectGridLoader.cpp
Grids/ObjectGridLoader.h
Groups/Group.cpp
Groups/Group.h
Groups/GroupReference.cpp
Groups/GroupReference.h
Groups/GroupRefManager.h
Guilds/Guild.cpp
Guilds/Guild.h
Instances/InstanceData.cpp
Instances/InstanceData.h
Instances/InstanceSaveMgr.cpp
Instances/InstanceSaveMgr.h
Loot/LootMgr.cpp
Loot/LootMgr.h
Mails/Mail.cpp
Mails/Mail.h
Maps/Map.cpp
Maps/Map.h
Maps/MapInstanced.cpp
Maps/MapInstanced.h
Maps/MapManager.cpp
Maps/MapManager.h
Maps/MapUpdater.cpp
Maps/MapUpdater.h
Maps/MapReference.h
Maps/MapRefManager.h
Maps/ZoneScript.h
Miscellaneous/Formulas.h
Miscellaneous/Language.h
Miscellaneous/SharedDefines.h
Movement/MovementGenerators/ConfusedMovementGenerator.cpp
Movement/MovementGenerators/ConfusedMovementGenerator.h
Movement/MovementGenerators/FleeingMovementGenerator.cpp
Movement/MovementGenerators/FleeingMovementGenerator.h
Movement/MovementGenerators/HomeMovementGenerator.cpp
Movement/MovementGenerators/HomeMovementGenerator.h
Movement/MovementGenerators/IdleMovementGenerator.cpp
Movement/MovementGenerators/IdleMovementGenerator.h
Movement/MovementGenerators/PointMovementGenerator.cpp
Movement/MovementGenerators/PointMovementGenerator.h
Movement/MovementGenerators/RandomMovementGenerator.cpp
Movement/MovementGenerators/RandomMovementGenerator.h
Movement/MovementGenerators/TargetedMovementGenerator.cpp
Movement/MovementGenerators/TargetedMovementGenerator.h
Movement/MovementGenerators/WaypointMovementGenerator.cpp
Movement/MovementGenerators/WaypointMovementGenerator.h
Movement/Waypoints/Path.h
Movement/Waypoints/WaypointManager.cpp
Movement/Waypoints/WaypointManager.h
Movement/DestinationHolder.cpp
Movement/DestinationHolder.h
Movement/DestinationHolderImp.h
Movement/FollowerReference.cpp
Movement/FollowerReference.h
Movement/FollowerRefManager.h
Movement/MotionMaster.cpp
Movement/MotionMaster.h
Movement/MovementGenerator.cpp
Movement/MovementGenerator.h
Movement/MovementGeneratorImpl.h
Movement/Traveller.h
OutdoorPvP/Zones/OutdoorPvPEP.cpp
OutdoorPvP/Zones/OutdoorPvPEP.h
OutdoorPvP/Zones/OutdoorPvPHP.cpp
OutdoorPvP/Zones/OutdoorPvPHP.h
OutdoorPvP/Zones/OutdoorPvPNA.cpp
OutdoorPvP/Zones/OutdoorPvPNA.h
OutdoorPvP/Zones/OutdoorPvPSI.cpp
OutdoorPvP/Zones/OutdoorPvPSI.h
OutdoorPvP/Zones/OutdoorPvPTF.cpp
OutdoorPvP/Zones/OutdoorPvPTF.h
OutdoorPvP/Zones/OutdoorPvPZM.cpp
OutdoorPvP/Zones/OutdoorPvPZM.h
OutdoorPvP/OutdoorPvP.cpp
OutdoorPvP/OutdoorPvP.h
OutdoorPvP/OutdoorPvPImpl.h
OutdoorPvP/OutdoorPvPMgr.cpp
OutdoorPvP/OutdoorPvPMgr.h
Pools/PoolHandler.cpp
Pools/PoolHandler.h
Quests/QuestDef.cpp
Quests/QuestDef.h
Reputation/ReputationMgr.cpp
Reputation/ReputationMgr.h
Scripting/ScriptLoader.cpp
Scripting/ScriptLoader.h
Scripting/ScriptMgr.cpp
Scripting/ScriptMgr.h
Scripting/ScriptSystem.cpp
Scripting/ScriptSystem.h
Server/Protocol/Handlers/AddonHandler.cpp
Server/Protocol/Handlers/AddonHandler.h
Server/Protocol/Handlers/ArenaTeamHandler.cpp
Server/Protocol/Handlers/AuctionHouseHandler.cpp
Server/Protocol/Handlers/BattleGroundHandler.cpp
@@ -284,7 +149,6 @@ set(game_STAT_SRCS
Server/Protocol/Handlers/MiscHandler.cpp
Server/Protocol/Handlers/MovementHandler.cpp
Server/Protocol/Handlers/NPCHandler.cpp
Server/Protocol/Handlers/NPCHandler.h
Server/Protocol/Handlers/PetHandler.cpp
Server/Protocol/Handlers/PetitionsHandler.cpp
Server/Protocol/Handlers/QueryHandler.cpp
@@ -296,37 +160,21 @@ set(game_STAT_SRCS
Server/Protocol/Handlers/TradeHandler.cpp
Server/Protocol/Handlers/VoiceChatHandler.cpp
Server/Protocol/Opcodes.cpp
Server/Protocol/Opcodes.h
Server/Protocol/WorldLog.cpp
Server/Protocol/WorldLog.h
Server/WorldSession.cpp
Server/WorldSession.h
Server/WorldSocket.cpp
Server/WorldSocket.h
Server/WorldSocketMgr.cpp
Server/WorldSocketMgr.h
Skills/SkillDiscovery.cpp
Skills/SkillDiscovery.h
Skills/SkillExtraItems.cpp
Skills/SkillExtraItems.h
Spells/Auras/SpellAuraDefines.h
Spells/Auras/SpellAuras.cpp
Spells/Auras/SpellAuras.h
Spells/Auras/SpellAuraEffects.cpp
Spells/Auras/SpellAuraEffects.h
Spells/Auras/SpellEffects.cpp
Spells/Spell.cpp
Spells/Spell.h
Spells/SpellMgr.cpp
Spells/SpellMgr.h
Tools/PlayerDump.cpp
Tools/PlayerDump.h
Tools/Tools.cpp
Tools/Tools.h
Weather/Weather.cpp
Weather/Weather.h
World/World.cpp
World/World.h
)
include_directories(
@@ -423,17 +271,10 @@ include_directories(
if(NOT DO_SCRIPTS)
set(game_STAT_SRCS ${game_STAT_SRCS}
AI/ScriptedAI/ScriptedEscortAI.cpp
AI/ScriptedAI/ScriptedEscortAI.h
AI/ScriptedAI/ScriptedCreature.cpp
AI/ScriptedAI/ScriptedCreature.h
AI/ScriptedAI/ScriptedFollowerAI.cpp
AI/ScriptedAI/ScriptedFollowerAI.h
AI/ScriptedAI/ScriptedGossip.h
AI/ScriptedAI/ScriptedGuardAI.cpp
AI/ScriptedAI/ScriptedGuardAI.h
AI/ScriptedAI/ScriptedInstance.h
AI/ScriptedAI/ScriptedSimpleAI.cpp
AI/ScriptedAI/ScriptedSimpleAI.h
)
message("-- Added basic scriptAI-engines to GAME library")
endif()
+4 -17
View File
@@ -1379,28 +1379,15 @@ bool Position::HasInArc(float arc, const Position *obj) const
return true;
// move arc to range 0.. 2*pi
while (arc >= 2.0f * M_PI)
arc -= 2.0f * M_PI;
while (arc < 0)
arc += 2.0f * M_PI;
arc = MapManager::NormalizeOrientation(arc);
float angle = GetAngle(obj);
angle -= m_orientation;
//if (angle > 100 || angle < -100)
//{
// sLog.outCrash("Invalid Angle %f: this %u %u %f %f %f %f, that %u %u %f %f %f %f", angle,
// GetEntry(), GetGUIDLow(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation(),
// obj->GetEntry(), obj->GetGUIDLow(), obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), obj->GetOrientation());
// assert(false);
// return false;
//}
// move angle to range -pi ... +pi
while (angle > M_PI)
angle -= 2.0f * M_PI;
while (angle < -M_PI)
angle += 2.0f * M_PI;
angle = MapManager::NormalizeOrientation(angle);
if(angle > M_PI)
angle -= 2.0f*M_PI;
float lborder = -1 * (arc/2.0f); // in range -pi..0
float rborder = (arc/2.0f); // in range 0..pi
+15
View File
@@ -108,6 +108,21 @@ class MapManager : public Trinity::Singleton<MapManager, Trinity::ClassLevelLock
return IsValidMapCoord(loc.GetMapId(), loc.GetPositionX(), loc.GetPositionY(), loc.GetPositionZ(), loc.GetOrientation());
}
// modulos a radian orientation to the range of 0..2PI
static float NormalizeOrientation(float o)
{
// fmod only supports positive numbers. Thus we have
// to emulate negative numbers
if(o < 0)
{
float mod = o *-1;
mod = fmod(mod, 2.0f*M_PI);
mod = -mod+2.0f*M_PI;
return mod;
}
return fmod(o, 2.0f*M_PI);
}
void DoDelayedMovesAndRemoves();
void LoadTransports();