From dd1d913ff28f95acd4e30670f725601a37c511d8 Mon Sep 17 00:00:00 2001 From: Schmoozerd Date: Tue, 8 May 2012 17:07:01 +0200 Subject: [PATCH] [11988] Fix a bug in SCRIPT_COMMAND_TEMP_SUMMON_CREATURE Now despawn-time will be treated as TEMPSUMMON_DEAD_DESPAWN as expected. Thanks to Xfurry for pointing. Also make the DB-scripts work only with players on the map. This might affect a few rare scripts, especially related to far-teleport Signed-off-by: Schmoozerd --- src/game/ScriptMgr.cpp | 6 +++--- src/shared/revision_nr.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game/ScriptMgr.cpp b/src/game/ScriptMgr.cpp index 811370b9e..f6ba08adc 100644 --- a/src/game/ScriptMgr.cpp +++ b/src/game/ScriptMgr.cpp @@ -822,7 +822,7 @@ bool ScriptAction::GetScriptCommandObject(const ObjectGuid guid, bool includeIte resultObject = m_map->GetPet(guid); break; case HIGHGUID_PLAYER: - resultObject = ObjectAccessor::FindPlayer(guid, false); + resultObject = m_map->GetPlayer(guid); break; case HIGHGUID_GAMEOBJECT: resultObject = m_map->GetGameObject(guid); @@ -835,7 +835,7 @@ bool ScriptAction::GetScriptCommandObject(const ObjectGuid guid, bool includeIte { if (includeItem) { - if (Player* player = ObjectAccessor::FindPlayer(m_ownerGuid, false)) + if (Player* player = m_map->GetPlayer(m_ownerGuid)) resultObject = player->GetItemByGuid(guid); break; } @@ -1245,7 +1245,7 @@ void ScriptAction::HandleScriptStep() float z = m_script->z; float o = m_script->o; - Creature* pCreature = pSource->SummonCreature(m_script->summonCreature.creatureEntry, x, y, z, o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, m_script->summonCreature.despawnDelay, (m_script->data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL) ? true: false); + Creature* pCreature = pSource->SummonCreature(m_script->summonCreature.creatureEntry, x, y, z, o, m_script->summonCreature.despawnDelay ? TEMPSUMMON_TIMED_OR_DEAD_DESPAWN : TEMPSUMMON_DEAD_DESPAWN, m_script->summonCreature.despawnDelay, (m_script->data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL) ? true: false); if (!pCreature) { sLog.outError(" DB-SCRIPTS: Process table `%s` id %u, command %u failed for creature (entry: %u).", m_table, m_script->id, m_script->command, m_script->summonCreature.creatureEntry); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 8916b055d..eda69b72f 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11987" + #define REVISION_NR "11988" #endif // __REVISION_NR_H__