From 27bc3b17510a172cfa713e964eb2b6a9645cad18 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sun, 1 Sep 2013 02:20:17 +0200 Subject: Core/Creatures: Added error log for SPELL_AURA_CONTROL_VEHICLE auras in creature_addon / creature_template_addon --- src/server/game/Globals/ObjectMgr.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/server/game') diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 39dea3ca5fe..f5d8cca70e3 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -560,6 +560,10 @@ void ObjectMgr::LoadCreatureTemplateAddons() TC_LOG_ERROR(LOG_FILTER_SQL, "Creature (Entry: %u) has wrong spell %u defined in `auras` field in `creature_template_addon`.", entry, uint32(atol(*itr))); continue; } + + if (AdditionalSpellInfo->HasAura(SPELL_AURA_CONTROL_VEHICLE)) + TC_LOG_ERROR(LOG_FILTER_SQL, "Creature (Entry: %u) has SPELL_AURA_CONTROL_VEHICLE aura %u defined in `auras` field in `creature_template_addon`.", entry, uint32(atol(*itr))); + creatureAddon.auras[i++] = uint32(atol(*itr)); } @@ -574,7 +578,7 @@ void ObjectMgr::LoadCreatureTemplateAddons() if (!sEmotesStore.LookupEntry(creatureAddon.emote)) { - TC_LOG_ERROR(LOG_FILTER_SQL, "Creature (Entry: %u) has invalid emote (%u) defined in `creature_addon`.", entry, creatureAddon.emote); + TC_LOG_ERROR(LOG_FILTER_SQL, "Creature (Entry: %u) has invalid emote (%u) defined in `creature_template_addon`.", entry, creatureAddon.emote); creatureAddon.emote = 0; } @@ -933,6 +937,10 @@ void ObjectMgr::LoadCreatureAddons() TC_LOG_ERROR(LOG_FILTER_SQL, "Creature (GUID: %u) has wrong spell %u defined in `auras` field in `creature_addon`.", guid, uint32(atol(*itr))); continue; } + + if (AdditionalSpellInfo->HasAura(SPELL_AURA_CONTROL_VEHICLE)) + TC_LOG_ERROR(LOG_FILTER_SQL, "Creature (GUID: %u) has SPELL_AURA_CONTROL_VEHICLE aura %u defined in `auras` field in `creature_addon`.", guid, uint32(atol(*itr))); + creatureAddon.auras[i++] = uint32(atol(*itr)); } -- cgit v1.2.3 From 016dac995ef9b4dcf022e3944bf2089fea87dee9 Mon Sep 17 00:00:00 2001 From: Discover- Date: Sun, 1 Sep 2013 10:49:29 +0200 Subject: Core/SmartAI: Add a spellid to SMART_EVENT_TARGET_CASTING. If left on 0, it checks for all spells (like it did without these changes) --- src/server/game/AI/SmartScripts/SmartScript.cpp | 22 ++++++++++++++++------ src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 17 +++++++++++++---- src/server/game/AI/SmartScripts/SmartScriptMgr.h | 13 ++++++++++--- 3 files changed, 39 insertions(+), 13 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 3285ce4dec9..0602d2b83fd 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -2643,10 +2643,20 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui } case SMART_EVENT_TARGET_CASTING: { - if (!me || !me->IsInCombat() || !me->GetVictim() || !me->GetVictim()->IsNonMeleeSpellCasted(false, false, true)) + if (!me || !me->IsInCombat()) return; - ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->GetVictim()); + Unit* victim = me->GetVictim(); + + if (!victim || !victim->IsNonMeleeSpellCasted(false, false, true)) + return; + + if (e.event.targetCasting.spellId > 0) + if (Spell* currSpell = victim->GetCurrentSpell(CURRENT_GENERIC_SPELL)) + if (currSpell->m_spellInfo->Id != e.event.targetCasting.spellId) + return; + + ProcessTimedAction(e, e.event.targetCasting.repeatMin, e.event.targetCasting.repeatMax, me->GetVictim()); break; } case SMART_EVENT_FRIENDLY_HEALTH: @@ -2654,10 +2664,10 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui if (!me || !me->IsInCombat()) return; - Unit* target = DoSelectLowestHpFriendly((float)e.event.friendlyHealt.radius, e.event.friendlyHealt.hpDeficit); + Unit* target = DoSelectLowestHpFriendly((float)e.event.friendlyHealth.radius, e.event.friendlyHealth.hpDeficit); if (!target || !target->IsInCombat()) return; - ProcessTimedAction(e, e.event.friendlyHealt.repeatMin, e.event.friendlyHealt.repeatMax, target); + ProcessTimedAction(e, e.event.friendlyHealth.repeatMin, e.event.friendlyHealth.repeatMax, target); break; } case SMART_EVENT_FRIENDLY_IS_CC: @@ -3005,7 +3015,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui { uint32 healthPct = uint32((*itr)->ToUnit()->GetHealthPct()); - if (healthPct > e.event.friendlyHealtPct.maxHpPct || healthPct < e.event.friendlyHealtPct.minHpPct) + if (healthPct > e.event.friendlyHealthPct.maxHpPct || healthPct < e.event.friendlyHealthPct.minHpPct) continue; target = (*itr)->ToUnit(); @@ -3018,7 +3028,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui if (!target) return; - ProcessTimedAction(e, e.event.friendlyHealtPct.repeatMin, e.event.friendlyHealtPct.repeatMax, target); + ProcessTimedAction(e, e.event.friendlyHealthPct.repeatMin, e.event.friendlyHealthPct.repeatMax, target); break; } default: diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 37aad3f4fa4..3e07eb828bc 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -407,10 +407,10 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) } break; case SMART_EVENT_FRIENDLY_HEALTH: - if (!NotNULL(e, e.event.friendlyHealt.radius)) + if (!NotNULL(e, e.event.friendlyHealth.radius)) return false; - if (!IsMinMaxValid(e, e.event.friendlyHealt.repeatMin, e.event.friendlyHealt.repeatMax)) + if (!IsMinMaxValid(e, e.event.friendlyHealth.repeatMin, e.event.friendlyHealth.repeatMax)) return false; break; case SMART_EVENT_FRIENDLY_IS_CC: @@ -437,6 +437,15 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) return false; break; case SMART_EVENT_TARGET_CASTING: + if (e.event.targetCasting.spellId > 0 && !sSpellMgr->GetSpellInfo(e.event.targetCasting.spellId)) + { + sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Spell entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.spellHit.spell); + return false; + } + + if (!IsMinMaxValid(e, e.event.targetCasting.repeatMin, e.event.targetCasting.repeatMax)) + return false; + break; case SMART_EVENT_PASSENGER_BOARDED: case SMART_EVENT_PASSENGER_REMOVED: if (!IsMinMaxValid(e, e.event.minMax.repeatMin, e.event.minMax.repeatMax)) @@ -546,10 +555,10 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) break; } case SMART_EVENT_FRIENDLY_HEALTH_PCT: - if (!IsMinMaxValid(e, e.event.friendlyHealtPct.repeatMin, e.event.friendlyHealtPct.repeatMax)) + if (!IsMinMaxValid(e, e.event.friendlyHealthPct.repeatMin, e.event.friendlyHealthPct.repeatMax)) return false; - if (e.event.friendlyHealtPct.maxHpPct > 100 || e.event.friendlyHealtPct.minHpPct > 100) + if (e.event.friendlyHealthPct.maxHpPct > 100 || e.event.friendlyHealthPct.minHpPct > 100) { TC_LOG_ERROR(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has pct value above 100, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); return false; diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 4c0f5d1b25b..6aeae1a4b21 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -94,7 +94,7 @@ enum SMART_EVENT SMART_EVENT_OOC_LOS = 10, // NoHostile, MaxRnage, CooldownMin, CooldownMax SMART_EVENT_RESPAWN = 11, // type, MapId, ZoneId SMART_EVENT_TARGET_HEALTH_PCT = 12, // HPMin%, HPMax%, RepeatMin, RepeatMax - SMART_EVENT_TARGET_CASTING = 13, // RepeatMin, RepeatMax + SMART_EVENT_TARGET_CASTING = 13, // RepeatMin, RepeatMax, spellid SMART_EVENT_FRIENDLY_HEALTH = 14, // HPDeficit, Radius, RepeatMin, RepeatMax SMART_EVENT_FRIENDLY_IS_CC = 15, // Radius, RepeatMin, RepeatMax SMART_EVENT_FRIENDLY_MISSING_BUFF = 16, // SpellId, Radius, RepeatMin, RepeatMax @@ -213,13 +213,20 @@ struct SmartEvent uint32 repeatMax; } minMax; + struct + { + uint32 repeatMin; + uint32 repeatMax; + uint32 spellId; + } targetCasting; + struct { uint32 hpDeficit; uint32 radius; uint32 repeatMin; uint32 repeatMax; - } friendlyHealt; + } friendlyHealth; struct { @@ -368,7 +375,7 @@ struct SmartEvent uint32 maxHpPct; uint32 repeatMin; uint32 repeatMax; - } friendlyHealtPct; + } friendlyHealthPct; struct { -- cgit v1.2.3 From 7d7fc7b66220775eb76b63a6511882e83d85c3e3 Mon Sep 17 00:00:00 2001 From: Discover- Date: Sun, 1 Sep 2013 13:44:08 +0200 Subject: Core/SAI: Also use loot recipient for SMART_ACTION_CALL_KILLEDMONSTER when target is SMART_TARGET_SELF (used in four cases in a clean TDB which will be fixed by this) --- src/server/game/AI/SmartScripts/SmartScript.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server/game') diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 3285ce4dec9..15b4676791b 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -876,7 +876,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u } case SMART_ACTION_CALL_KILLEDMONSTER: { - if (e.target.type == SMART_TARGET_NONE) // Loot recipient and his group members + if (e.target.type == SMART_TARGET_NONE || e.target.type == SMART_TARGET_SELF) // Loot recipient and his group members { if (!me) break; -- cgit v1.2.3 From 8ba8190773328bf449881525c66add6cec3c7b71 Mon Sep 17 00:00:00 2001 From: Discover- Date: Sun, 1 Sep 2013 13:56:35 +0200 Subject: Core/SAI: Allow using SMART_ACTION_SET_HOME_POS with multiple target types --- src/server/game/AI/SmartScripts/SmartScript.cpp | 34 +++++++++++++++++++++---- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 3285ce4dec9..8115978853f 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1362,15 +1362,18 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (!me) break; - ObjectList* targets = GetTargets(e, unit); if (e.GetTargetType() == SMART_TARGET_SELF) me->SetFacingTo(me->GetHomePosition().GetOrientation()); else if (e.GetTargetType() == SMART_TARGET_POSITION) me->SetFacingTo(e.target.o); - else if (targets && !targets->empty()) - me->SetFacingToObject(*targets->begin()); + else if (ObjectList* targets = GetTargets(e, unit)) + { + if (!targets->empty()) + me->SetFacingToObject(*targets->begin()); + + delete targets; + } - delete targets; break; } case SMART_ACTION_PLAYMOVIE: @@ -1901,11 +1904,13 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { if (Creature* creature = (*itr)->ToCreature()) { creature->GetMotionMaster()->Clear(); creature->GetMotionMaster()->MoveJump(e.target.x, e.target.y, e.target.z, (float)e.action.jump.speedxy, (float)e.action.jump.speedz); } + } /// @todo Resume path when reached jump location delete targets; @@ -1972,6 +1977,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { if (Player* player = (*itr)->ToPlayer()) { if (e.action.sendGossipMenu.gossipMenuId) @@ -1981,6 +1987,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u player->SEND_GOSSIP_MENU(e.action.sendGossipMenu.gossipNpcTextId, GetBaseObject()->GetGUID()); } + } delete targets; break; @@ -1992,15 +1999,32 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { if (IsCreature(*itr)) { if (e.GetTargetType() == SMART_TARGET_SELF) (*itr)->ToCreature()->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); else if (e.GetTargetType() == SMART_TARGET_POSITION) (*itr)->ToCreature()->SetHomePosition(e.target.x, e.target.y, e.target.z, e.target.o); + else if (e.GetTargetType() == SMART_TARGET_CREATURE_RANGE || e.GetTargetType() == SMART_TARGET_CREATURE_GUID || + e.GetTargetType() == SMART_TARGET_CREATURE_DISTANCE || e.GetTargetType() == SMART_TARGET_GAMEOBJECT_RANGE || + e.GetTargetType() == SMART_TARGET_GAMEOBJECT_GUID || e.GetTargetType() == SMART_TARGET_GAMEOBJECT_DISTANCE || + e.GetTargetType() == SMART_TARGET_CLOSEST_CREATURE || e.GetTargetType() == SMART_TARGET_CLOSEST_GAMEOBJECT || + e.GetTargetType() == SMART_TARGET_OWNER_OR_SUMMONER || e.GetTargetType() == SMART_TARGET_ACTION_INVOKER || + e.GetTargetType() == SMART_TARGET_CLOSEST_ENEMY || e.GetTargetType() == SMART_TARGET_CLOSEST_FRIENDLY) + { + if (ObjectList* targets = GetTargets(e, unit)) + { + if (WorldObject* target = targets->front()) + (*itr)->ToCreature()->SetHomePosition(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation()); + + delete targets; + } + } else - TC_LOG_ERROR(LOG_FILTER_SQL, "SmartScript: Action target for SMART_ACTION_SET_HOME_POS is not using SMART_TARGET_SELF or SMART_TARGET_POSITION, skipping"); + TC_LOG_ERROR(LOG_FILTER_SQL, "SmartScript: Action target for SMART_ACTION_SET_HOME_POS is invalid, skipping"); } + } delete targets; break; -- cgit v1.2.3 From 6b60877e3e54e996fdfec01920050acf033d4c6f Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 1 Sep 2013 17:48:47 +0200 Subject: Core/NetworkIO: Fixed memory leak --- src/server/game/Server/WorldSession.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index ffd8805901a..0e85815a054 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -277,18 +277,15 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) { if (!AntiDOS.EvaluateOpcode(*packet)) { - delete packet; - packet = NULL; KickPlayer(); } - - if (packet && packet->GetOpcode() >= NUM_MSG_TYPES) + else if (packet->GetOpcode() >= NUM_MSG_TYPES) { TC_LOG_ERROR(LOG_FILTER_OPCODES, "Received non-existed opcode %s from %s", GetOpcodeNameForLogging(packet->GetOpcode()).c_str() , GetPlayerInfo().c_str()); sScriptMgr->OnUnknownPacketReceive(m_Socket, WorldPacket(*packet)); } - else if (packet) + else { OpcodeHandler &opHandle = opcodeTable[packet->GetOpcode()]; try @@ -373,7 +370,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) break; } } - catch(ByteBufferException &) + catch (ByteBufferException const&) { TC_LOG_ERROR(LOG_FILTER_GENERAL, "WorldSession::Update ByteBufferException occured while parsing a packet (opcode: %u) from client %s, accountid=%i. Skipped packet.", packet->GetOpcode(), GetRemoteAddress().c_str(), GetAccountId()); @@ -383,6 +380,8 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) if (deletePacket) delete packet; + + deletePacket = true; } if (m_Socket && !m_Socket->IsClosed() && _warden) -- cgit v1.2.3 From e1e1067d172f9b1a6ba770ca6ae53a07dbc9d56f Mon Sep 17 00:00:00 2001 From: jackpoz Date: Sun, 1 Sep 2013 18:49:49 +0200 Subject: Core/Thread: Fix race condition in FreezeDetectorRunnable Fix race condition by replacing a static volatile uint32 with proper atomic thread-safe ACE_Atomic_Op, incremented in WorldRunnable::run() at each world loop and read in FreezeDetectorRunnable::run(). Helgrind log: Possible data race during read of size 4 at 0x2400D54 by thread #12 Locks held: none at 0x100FEA6: FreezeDetectorRunnable::run() (Master.cpp:106) by 0x1637892: ACE_Based::Thread::ThreadTask(void*) (Threading.cpp:186) by 0x518F555: ACE_OS_Thread_Adapter::invoke() (OS_Thread_Adapter.cpp:103) by 0x4C2B5AD: mythread_wrapper (hg_intercepts.c:219) by 0x61DAB4F: start_thread (pthread_create.c:304) by 0x6C69A7C: clone (clone.S:112) This conflicts with a previous write of size 4 by thread #9 Locks held: none at 0x100C23E: WorldRunnable::run() (WorldRunnable.cpp:55) by 0x1637892: ACE_Based::Thread::ThreadTask(void*) (Threading.cpp:186) by 0x518F555: ACE_OS_Thread_Adapter::invoke() (OS_Thread_Adapter.cpp:103) by 0x4C2B5AD: mythread_wrapper (hg_intercepts.c:219) by 0x61DAB4F: start_thread (pthread_create.c:304) by 0x6C69A7C: clone (clone.S:112) --- src/server/game/World/World.cpp | 2 +- src/server/game/World/World.h | 2 +- src/server/worldserver/Master.cpp | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 2bc4f3a0258..12ec033dfa7 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -83,7 +83,7 @@ ACE_Atomic_Op World::m_stopEvent = false; uint8 World::m_ExitCode = SHUTDOWN_EXIT_CODE; -volatile uint32 World::m_worldLoopCounter = 0; +ACE_Atomic_Op World::m_worldLoopCounter = 0; float World::m_MaxVisibleDistanceOnContinents = DEFAULT_VISIBILITY_DISTANCE; float World::m_MaxVisibleDistanceInInstances = DEFAULT_VISIBILITY_INSTANCE; diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index bf90b5ac01a..d4d9c4e2431 100644 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -514,7 +514,7 @@ struct CharacterNameData class World { public: - static volatile uint32 m_worldLoopCounter; + static ACE_Atomic_Op m_worldLoopCounter; World(); ~World(); diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index b2a6b60ac4f..d9b97cfd3f5 100644 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -103,10 +103,11 @@ public: ACE_Based::Thread::Sleep(1000); uint32 curtime = getMSTime(); // normal work - if (_loops != World::m_worldLoopCounter) + uint32 worldLoopCounter = World::m_worldLoopCounter.value(); + if (_loops != worldLoopCounter) { _lastChange = curtime; - _loops = World::m_worldLoopCounter; + _loops = worldLoopCounter; } // possible freeze else if (getMSTimeDiff(_lastChange, curtime) > _delaytime) -- cgit v1.2.3 From a762df0aba97a75c6061de41f8076f9f02b25dc5 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 1 Sep 2013 18:01:59 +0100 Subject: Core/SAI: Fix processing linked events when return is used in ProcessAction Thanks Discover- Closes #10688 --- src/server/game/AI/SmartScripts/SmartScript.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 2d6046cbddf..8cd8062d529 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -731,7 +731,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u me->AI()->EnterEvadeMode(); TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_EVADE: Creature %u EnterEvadeMode", me->GetGUIDLow()); - return; + break; } case SMART_ACTION_FLEE_FOR_ASSIST: { @@ -1445,7 +1445,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { TC_LOG_ERROR(LOG_FILTER_SQL, "SmartScript: SMART_ACTION_EQUIP uses non-existent equipment info id %u for creature %u", equipId, npc->GetEntry()); delete targets; - return; + break; } npc->SetCurrentEquipmentId(equipId); @@ -1913,7 +1913,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (!storedTargets) { delete targets; - return; + break; } for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) @@ -2101,7 +2101,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (!sGameEventMgr->IsActiveEvent(eventId)) { TC_LOG_ERROR(LOG_FILTER_SQL, "SmartScript::ProcessAction: At case SMART_ACTION_GAME_EVENT_STOP, inactive event (id: %u)", eventId); - return; + break; } sGameEventMgr->StopEvent(eventId, true); break; @@ -2112,7 +2112,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (sGameEventMgr->IsActiveEvent(eventId)) { TC_LOG_ERROR(LOG_FILTER_SQL, "SmartScript::ProcessAction: At case SMART_ACTION_GAME_EVENT_START, already activated event (id: %u)", eventId); - return; + break; } sGameEventMgr->StartEvent(eventId, true); break; -- cgit v1.2.3 From e8a566b3b1a65629fdba9b548f991e95f30eeed1 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 1 Sep 2013 22:30:07 +0200 Subject: Core/Objects: Removed obsolete code --- src/server/game/Entities/Object/Object.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 6cd61dc043c..5a787f910b8 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -137,20 +137,7 @@ void Object::_Create(uint32 guidlow, uint32 entry, HighGuid guidhigh) uint64 guid = MAKE_NEW_GUID(guidlow, entry, guidhigh); SetUInt64Value(OBJECT_FIELD_GUID, guid); - uint32 type = 0; - switch (m_objectType) - { - //case TYPEID_ITEM: type = 3; break; - //case TYPEID_CONTAINER: type = 7; break; //+4 - //case TYPEID_UNIT: type = 9; break; //+2 - //case TYPEID_PLAYER: type = 25; break; //+16 - //case TYPEID_GAMEOBJECT: type = 33; break; //+8 - case TYPEID_DYNAMICOBJECT: type = 65; break; //+32 - //case TYPEID_CORPSE: type = 129; break; //+64 - default: type = m_objectType; break; - } - SetUInt32Value(OBJECT_FIELD_TYPE, type); - //SetUInt32Value(OBJECT_FIELD_TYPE, m_objectType); + SetUInt32Value(OBJECT_FIELD_TYPE, m_objectType); m_PackGUID.wpos(0); m_PackGUID.appendPackGUID(GetGUID()); } -- cgit v1.2.3 From 1417f624537f2bf7a57dd8762332d0b684727aa1 Mon Sep 17 00:00:00 2001 From: jackpoz Date: Sun, 1 Sep 2013 12:50:00 +0200 Subject: Core/Spell: Fix farsight log error "Player requests non-existing seer" Partially revert 167ca565d044915f01ead4b189754ab1c44cc981 which wrongly used TYPEMASK_UNIT to denote Creatures and Players, so when a Player sent farsight opcode with another Player as target HandleFarSightOpcode() couldn't find the right Unit filtering by typemask TYPEMASK_SEER. --- src/server/game/Entities/Object/Object.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server/game') diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 4c48d80762d..cb731bfe5e8 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -54,7 +54,7 @@ enum TypeMask TYPEMASK_GAMEOBJECT = 0x0020, TYPEMASK_DYNAMICOBJECT = 0x0040, TYPEMASK_CORPSE = 0x0080, - TYPEMASK_SEER = TYPEMASK_UNIT | TYPEMASK_DYNAMICOBJECT + TYPEMASK_SEER = TYPEMASK_PLAYER | TYPEMASK_UNIT | TYPEMASK_DYNAMICOBJECT }; enum TypeID -- cgit v1.2.3