fix(Core/Condition): CONDITION_RANDOM_DUNGEON difficulty param (#24283)

This commit is contained in:
sogladev
2026-01-01 12:33:08 +01:00
committed by GitHub
parent 82d44ca930
commit 1fc66dc3dc
2 changed files with 10 additions and 5 deletions

View File

@@ -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;