mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
fix(Core/Condition): CONDITION_RANDOM_DUNGEON difficulty param (#24283)
This commit is contained in:
@@ -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)
|
if (!ConditionValue1)
|
||||||
condMeets = true;
|
condMeets = true;
|
||||||
else if (Map* map = player->GetMap())
|
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;
|
break;
|
||||||
case CONDITION_RANDOM_DUNGEON:
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
if (cond->ConditionValue2)
|
|
||||||
LOG_ERROR("sql.sql", "RandomDungeon condition has useless data in value2 ({}).", cond->ConditionValue2);
|
|
||||||
if (cond->ConditionValue3)
|
if (cond->ConditionValue3)
|
||||||
LOG_ERROR("sql.sql", "RandomDungeon condition has useless data in value3 ({}).", cond->ConditionValue3);
|
LOG_ERROR("sql.sql", "RandomDungeon condition has useless data in value3 ({}).", cond->ConditionValue3);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user