mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-22 05:27:19 +00:00
Amend preconditions fix
This commit is contained in:
parent
6be65569de
commit
d57c5101f4
@ -139,12 +139,19 @@ bool Precondition::CheckValue(Entity* player, const uint32_t value, bool evaluat
|
|||||||
case PreconditionType::DoesNotHaveItem:
|
case PreconditionType::DoesNotHaveItem:
|
||||||
return inventoryComponent->IsEquipped(value) < count;
|
return inventoryComponent->IsEquipped(value) < count;
|
||||||
case PreconditionType::HasAchievement:
|
case PreconditionType::HasAchievement:
|
||||||
|
if (missionComponent == nullptr) return false;
|
||||||
return missionComponent->GetMissionState(value) >= eMissionState::COMPLETE;
|
return missionComponent->GetMissionState(value) >= eMissionState::COMPLETE;
|
||||||
case PreconditionType::MissionAvailable:
|
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:
|
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:
|
case PreconditionType::MissionComplete:
|
||||||
|
if (missionComponent == nullptr) return false;
|
||||||
return missionComponent->GetMissionState(value) >= eMissionState::COMPLETE;
|
return missionComponent->GetMissionState(value) >= eMissionState::COMPLETE;
|
||||||
case PreconditionType::PetDeployed:
|
case PreconditionType::PetDeployed:
|
||||||
return false; // TODO
|
return false; // TODO
|
||||||
|
Loading…
Reference in New Issue
Block a user