[10303] Clarify bool used for script call ProcessEventId

isStart is default true. For transport/taxi cases, it may be false for event id's at arrival (event id ending)

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2010-08-01 02:19:06 +02:00
parent 2455450cc0
commit 787fb83763
6 changed files with 10 additions and 10 deletions

View file

@ -289,14 +289,14 @@ bool AreaTrigger ( Player *player, AreaTriggerEntry* atEntry )
}
MANGOS_DLL_EXPORT
bool ProcessEventId(uint32 eventId, Object* source, Object* target, bool data)
bool ProcessEventId(uint32 eventId, Object* source, Object* target, bool isStart)
{
Script *tmpscript = m_scripts[GetEventIdScriptId(eventId)];
if (!tmpscript || !tmpscript->pProcessEventId)
return false;
// data normally false, true for taxi event id where it's a departure
return tmpscript->pProcessEventId(eventId, source, target, data);
// isStart are normally true. For taxi event id at arrival, it's false
return tmpscript->pProcessEventId(eventId, source, target, isStart);
}
MANGOS_DLL_EXPORT

View file

@ -65,7 +65,7 @@ struct Script
bool (*pItemHello )(Player *player, Item *_Item, Quest const*_Quest );
bool (*pGOHello )(Player *player, GameObject *_GO );
bool (*pAreaTrigger )(Player *player, AreaTriggerEntry* at);
bool (*pProcessEventId )(uint32 eventId, Object* source, Object* target, bool data);
bool (*pProcessEventId )(uint32 eventId, Object* source, Object* target, bool isStart);
bool (*pItemQuestAccept )(Player *player, Item *_Item, Quest const*_Quest );
bool (*pGOQuestAccept )(Player *player, GameObject *_GO, Quest const*_Quest );
bool (*pGOChooseReward )(Player *player, GameObject *_GO, Quest const*_Quest, uint32 opt );

View file

@ -913,7 +913,7 @@ void GameObject::Use(Unit* user)
{
DEBUG_LOG("Chest ScriptStart id %u for GO %u", GetGOInfo()->chest.eventId, GetDBTableGUIDLow());
if (!Script->ProcessEventId(GetGOInfo()->chest.eventId, user, this, false))
if (!Script->ProcessEventId(GetGOInfo()->chest.eventId, user, this, true))
GetMap()->ScriptsStart(sEventScripts, GetGOInfo()->chest.eventId, user, this);
}
@ -1019,7 +1019,7 @@ void GameObject::Use(Unit* user)
{
DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Goober ScriptStart id %u for GO entry %u (GUID %u).", info->goober.eventId, GetEntry(), GetDBTableGUIDLow());
if (!Script->ProcessEventId(info->goober.eventId, player, this, false))
if (!Script->ProcessEventId(info->goober.eventId, player, this, true))
GetMap()->ScriptsStart(sEventScripts, info->goober.eventId, player, this);
}
@ -1082,7 +1082,7 @@ void GameObject::Use(Unit* user)
if (info->camera.eventID)
{
if (!Script->ProcessEventId(info->camera.eventID, player, this, false))
if (!Script->ProcessEventId(info->camera.eventID, player, this, true))
GetMap()->ScriptsStart(sEventScripts, info->camera.eventID, player, this);
}

View file

@ -55,7 +55,7 @@ typedef bool(MANGOS_IMPORT * scriptCallChooseReward)( Player *player, Creature *
typedef bool(MANGOS_IMPORT * scriptCallItemHello)( Player *player, Item *, Quest const*);
typedef bool(MANGOS_IMPORT * scriptCallGOHello)( Player *player, GameObject * );
typedef bool(MANGOS_IMPORT * scriptCallAreaTrigger)( Player *player, AreaTriggerEntry const* );
typedef bool(MANGOS_IMPORT * scriptCallProcessEventId)(uint32 eventId, Object* source, Object* target, bool data);
typedef bool(MANGOS_IMPORT * scriptCallProcessEventId)(uint32 eventId, Object* source, Object* target, bool isStart);
typedef bool(MANGOS_IMPORT * scriptCallItemQuestAccept)(Player *player, Item *, Quest const*);
typedef bool(MANGOS_IMPORT * scriptCallGOQuestAccept)(Player *player, GameObject *, Quest const*);
typedef bool(MANGOS_IMPORT * scriptCallGOChooseReward)(Player *player, GameObject *, Quest const*, uint32 opt );

View file

@ -3097,7 +3097,7 @@ void Spell::EffectSendEvent(SpellEffectIndex effectIndex)
*/
DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "Spell ScriptStart %u for spellid %u in EffectSendEvent ", m_spellInfo->EffectMiscValue[effectIndex], m_spellInfo->Id);
if (!Script->ProcessEventId(m_spellInfo->EffectMiscValue[effectIndex], m_caster, focusObject, false))
if (!Script->ProcessEventId(m_spellInfo->EffectMiscValue[effectIndex], m_caster, focusObject, true))
m_caster->GetMap()->ScriptsStart(sEventScripts, m_spellInfo->EffectMiscValue[effectIndex], m_caster, focusObject);
}

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10302"
#define REVISION_NR "10303"
#endif // __REVISION_NR_H__