Fixed Racing Mission

* Try, Try Again achievement now progresses when the player gets last place in a race of 3 or more players, or when solo racing is enabled.
* Race Series 1 mission from Velocity Lane now progresses correctly.
This commit is contained in:
EmosewaMC
2022-04-18 01:04:29 -07:00
parent 8f50e4ff56
commit 5691df9009
2 changed files with 26 additions and 6 deletions

View File

@@ -183,7 +183,13 @@ bool MissionTask::InParameters(const uint32_t value) const
bool MissionTask::IsComplete() const
{
return progress >= info->targetValue;
// Mission 668 has task uid 984 which is a bit mask. Its completion value is 3.
if (info->uid == 984) {
return progress >= 3;
}
else {
return progress >= info->targetValue;
}
}
@@ -423,12 +429,23 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
if (parameters[0] != associate) break;
if (associate == 1 || associate == 15 || associate == 2 || associate == 3)
if (associate == 1 || associate == 2 || associate == 3)
{
if (value > info->targetValue) break;
AddProgress(info->targetValue);
}
// task 15 is a bit mask!
else if (associate == 15) {
if (!InAllTargets(value)) break;
auto tempProgress = GetProgress();
// If we won at Nimbus Station, set bit 0
if (value == 1203) SetProgress(tempProgress |= 1 << 0);
// If we won at Gnarled Forest, set bit 1
else if (value == 1303) SetProgress(tempProgress |= 1 << 1);
// If both bits are set, then the client sees the mission as complete.
}
else if (associate == 10)
{
// If the player did not crash during the race, progress this task by count.