Skip to content

Commit

Permalink
Fixed mission related preconditions
Browse files Browse the repository at this point in the history
  • Loading branch information
Wincent01 committed Sep 10, 2024
1 parent 94b9731 commit 6be6556
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions dGame/dUtilities/Preconditions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,21 +139,13 @@ bool Precondition::CheckValue(Entity* player, const uint32_t value, bool evaluat
case PreconditionType::DoesNotHaveItem:
return inventoryComponent->IsEquipped(value) < count;
case PreconditionType::HasAchievement:
mission = missionComponent->GetMission(value);

return mission == nullptr || mission->GetMissionState() >= eMissionState::COMPLETE;
return missionComponent->GetMissionState(value) >= eMissionState::COMPLETE;
case PreconditionType::MissionAvailable:
mission = missionComponent->GetMission(value);

return mission == nullptr || mission->GetMissionState() >= eMissionState::AVAILABLE;
return missionComponent->GetMissionState(value) >= eMissionState::AVAILABLE;
case PreconditionType::OnMission:
mission = missionComponent->GetMission(value);

return mission == nullptr || mission->GetMissionState() >= eMissionState::ACTIVE;
return missionComponent->GetMissionState(value) >= eMissionState::ACTIVE;
case PreconditionType::MissionComplete:
mission = missionComponent->GetMission(value);

return mission == nullptr ? false : mission->GetMissionState() >= eMissionState::COMPLETE;
return missionComponent->GetMissionState(value) >= eMissionState::COMPLETE;
case PreconditionType::PetDeployed:
return false; // TODO
case PreconditionType::HasFlag:
Expand Down

0 comments on commit 6be6556

Please sign in to comment.