Allow to set/del qglobals in encounters scripts

This commit is contained in:
Michael Cook (mackal) 2014-10-31 00:02:05 -04:00
parent 481492cb59
commit b417e23d97

View File

@ -1292,7 +1292,7 @@ void QuestManager::setglobal(const char *varname, const char *newvalue, int opti
QuestManagerCurrentQuestVars();
int qgZoneid = zone->GetZoneID();
int qgCharid = 0;
int qgNpcid = owner->GetNPCTypeID();
int qgNpcid = owner ? owner->GetNPCTypeID() : 0; // encounter scripts don't have an owner
/* options value determines the availability of global variables to NPCs when a quest begins
------------------------------------------------------------------
@ -1412,7 +1412,7 @@ void QuestManager::delglobal(const char *varname) {
QuestManagerCurrentQuestVars();
int qgZoneid = zone->GetZoneID();
int qgCharid = 0;
int qgNpcid=owner->GetNPCTypeID();
int qgNpcid = owner ? owner->GetNPCTypeID() : 0; // encounter scripts don't have an owner
if (initiator && initiator->IsClient()) // some events like waypoint and spawn don't have a player involved
qgCharid=initiator->CharacterID();