fix(mission): GetMissionState answers the client's state bit mask

LWOMissionComponent::getMissionState (0x00cd7400) returns a mask: COMPLETE
once the mission was completed, ORed with the state of the mission in
progress; a mission not in progress gets AVAILABLE when it was never
completed or is repeatable and its prerequisites are met, else 0. DLU's
handler answered UNKNOWN (-1, every bit set) for a mission that cannot be
taken and COMPLETE for a completed repeatable one, and ignored
cooldownInfoRequested. With cooldown info requested (0x00cd7770) the
client only checks the cooldown of a repeat in progress (state 9 or 10):
fewer whole minutes since the last completion than Missions.cooldownTime.

MissionComponent::GetMissionState, used across the server, is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-10-02 09:42:25 -05:00
parent 0253fea006
commit 8564e293fa
3 changed files with 70 additions and 8 deletions

View File

@@ -41,6 +41,14 @@ public:
* @return whether or not the mission identified by the specified ID can be accepted
*/
static bool CanAccept(uint32_t missionId, const std::unordered_map<uint32_t, Mission*>& missions);
/**
* Checks the prerequisites for a mission
* @param missionId the mission ID to check prerequisites for
* @param missions the mission inventory to check the prerequisites against
* @return whether or not the prerequisites of the mission identified by the specified ID are met
*/
static bool CheckPrerequisites(uint32_t missionId, const std::unordered_map<uint32_t, Mission*>& missions);
private:
/**
@@ -48,11 +56,4 @@ private:
*/
static std::unordered_map<uint32_t, PrerequisiteExpression*> expressions;
/**
* Checks the prerequisites for a mission
* @param missionId the mission ID to check prerequisites for
* @param missions the mission inventory to check the prerequisites against
* @return whether or not the mission identified by the specified ID can be accepted
*/
static bool CheckPrerequisites(uint32_t missionId, const std::unordered_map<uint32_t, Mission*>& missions);
};