Skip to content

Commit

Permalink
Amend preconditions fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Wincent01 committed Sep 12, 2024
1 parent 6be6556 commit d57c510
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions dGame/dUtilities/Preconditions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,19 @@ bool Precondition::CheckValue(Entity* player, const uint32_t value, bool evaluat
case PreconditionType::DoesNotHaveItem:
return inventoryComponent->IsEquipped(value) < count;

Check warning on line 140 in dGame/dUtilities/Preconditions.cpp

View workflow job for this annotation

GitHub Actions / Build & Test (windows-2022)

'<': unsafe use of type 'bool' in operation [D:\a\DarkflameServer\DarkflameServer\build\dGame\dUtilities\dUtilities.vcxproj]
case PreconditionType::HasAchievement:
if (missionComponent == nullptr) return false;
return missionComponent->GetMissionState(value) >= eMissionState::COMPLETE;
case PreconditionType::MissionAvailable:
return missionComponent->GetMissionState(value) >= eMissionState::AVAILABLE;
if (missionComponent == nullptr) return false;
return missionComponent->GetMissionState(value) == eMissionState::AVAILABLE || missionComponent->GetMissionState(value) == eMissionState::COMPLETE_AVAILABLE;
case PreconditionType::OnMission:
return missionComponent->GetMissionState(value) >= eMissionState::ACTIVE;
if (missionComponent == nullptr) return false;
return missionComponent->GetMissionState(value) == eMissionState::ACTIVE ||
missionComponent->GetMissionState(value) == eMissionState::COMPLETE_ACTIVE ||
missionComponent->GetMissionState(value) == eMissionState::READY_TO_COMPLETE ||
missionComponent->GetMissionState(value) == eMissionState::COMPLETE_READY_TO_COMPLETE;
case PreconditionType::MissionComplete:
if (missionComponent == nullptr) return false;
return missionComponent->GetMissionState(value) >= eMissionState::COMPLETE;
case PreconditionType::PetDeployed:
return false; // TODO
Expand Down

1 comment on commit d57c510

@EmosewaMC
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved changes

Please sign in to comment.