mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[10042] Implement CONDITION_QUESTAVAILABLE.
Also do come constatification of quest status check functions and fix one unsafe use std::map operator[]. Never never use std::map operator [] for _read_ access. Good chance corrupt related structure state ;) Not in found case but in general.
This commit is contained in:
parent
5ea6815ea1
commit
5eabf12111
6 changed files with 193 additions and 179 deletions
|
|
@ -7455,6 +7455,13 @@ bool PlayerCondition::Meets(Player const * player) const
|
|||
return data->CheckConditionCriteriaMeet(player, value1, value2);
|
||||
return false;
|
||||
}
|
||||
case CONDITION_QUESTAVAILABLE:
|
||||
{
|
||||
if (Quest const* quest = sObjectMgr.GetQuestTemplate(value1))
|
||||
return player->CanTakeQuest(quest, false);
|
||||
else
|
||||
false;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
@ -7563,6 +7570,7 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val
|
|||
}
|
||||
case CONDITION_QUESTREWARDED:
|
||||
case CONDITION_QUESTTAKEN:
|
||||
case CONDITION_QUESTAVAILABLE:
|
||||
{
|
||||
Quest const *Quest = sObjectMgr.GetQuestTemplate(value1);
|
||||
if (!Quest)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue