[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 <schmoozerd@scriptdev2.com>
This commit is contained in:
Schmoozerd 2012-05-08 17:07:01 +02:00
parent 0645d10286
commit dd1d913ff2
2 changed files with 4 additions and 4 deletions

View file

@ -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);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11987"
#define REVISION_NR "11988"
#endif // __REVISION_NR_H__