fix(Core/Condition): CONDITION_RANDOM_DUNGEON difficulty param (#24283)
This commit is contained in:
parent
82d44ca930
commit
1fc66dc3dc
2 changed files with 10 additions and 5 deletions
|
|
@ -0,0 +1,2 @@
|
|||
--
|
||||
UPDATE `conditions` SET `ConditionValue1` = 0 WHERE (`SourceTypeOrReferenceId` = 4) AND (`SourceGroup` = 24524) AND (`SourceEntry` = 52676) AND (`SourceId` = 0) AND (`ElseGroup` = 0) AND (`ConditionTypeOrReference` = 105);
|
||||
|
|
@ -553,7 +553,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
|
|||
if (!ConditionValue1)
|
||||
condMeets = true;
|
||||
else if (Map* map = player->GetMap())
|
||||
condMeets = map->GetDifficulty() == Difficulty(ConditionValue1);
|
||||
condMeets = map->GetDifficulty() == Difficulty(ConditionValue2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2487,13 +2487,16 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
|||
}
|
||||
break;
|
||||
case CONDITION_RANDOM_DUNGEON:
|
||||
if (cond->ConditionValue1 >= MAX_DIFFICULTY)
|
||||
if (cond->ConditionValue1 > 1)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "RandomDungeon condition has invalid difficulty in value1 ({}).", cond->ConditionValue1);
|
||||
LOG_ERROR("sql.sql", "RandomDungeon condition has useless data in value1 ({}).", cond->ConditionValue1);
|
||||
return false;
|
||||
}
|
||||
if (cond->ConditionValue2 >= MAX_DIFFICULTY)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "RandomDungeon condition has invalid difficulty in value2 ({}).", cond->ConditionValue1);
|
||||
return false;
|
||||
}
|
||||
if (cond->ConditionValue2)
|
||||
LOG_ERROR("sql.sql", "RandomDungeon condition has useless data in value2 ({}).", cond->ConditionValue2);
|
||||
if (cond->ConditionValue3)
|
||||
LOG_ERROR("sql.sql", "RandomDungeon condition has useless data in value3 ({}).", cond->ConditionValue3);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue