mirror of
https://github.com/DarkflameUniverse/DarkflameServer
synced 2024-08-30 18:43:58 +00:00
Fixed bugs with minigame progression
This commit is contained in:
parent
1607b506c8
commit
b077bd937d
@ -78,14 +78,7 @@ void MissionTask::SetProgress(const uint32_t value, const bool echo)
|
|||||||
|
|
||||||
std::vector<float> updates;
|
std::vector<float> updates;
|
||||||
updates.push_back(static_cast<float>(progress));
|
updates.push_back(static_cast<float>(progress));
|
||||||
|
GameMessages::SendNotifyMissionTask(entity, entity->GetSystemAddress(), static_cast<int>(info->id), static_cast<int>(1 << (mask + 1)), updates);
|
||||||
GameMessages::SendNotifyMissionTask(
|
|
||||||
entity,
|
|
||||||
entity->GetSystemAddress(),
|
|
||||||
static_cast<int>(info->id),
|
|
||||||
static_cast<int>(1 << (mask + 1)),
|
|
||||||
updates
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -190,15 +183,13 @@ bool MissionTask::InParameters(const uint32_t value) const
|
|||||||
|
|
||||||
bool MissionTask::IsComplete() const
|
bool MissionTask::IsComplete() const
|
||||||
{
|
{
|
||||||
// Minigames are the only ones where the target value is a score they need to get but the actual target is the act ID
|
return progress >= info->targetValue;
|
||||||
return GetType() == MissionTaskType::MISSION_TASK_TYPE_MINIGAME ? progress == info->target : progress >= info->targetValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MissionTask::Complete()
|
void MissionTask::Complete()
|
||||||
{
|
{
|
||||||
// Minigames are the only ones where the target value is a score they need to get but the actual target is the act ID
|
SetProgress(info->targetValue);
|
||||||
SetProgress(GetType() == MissionTaskType::MISSION_TASK_TYPE_MINIGAME ? info->target : info->targetValue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -354,7 +345,7 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(info->targetGroup == targets && value >= info->targetValue) {
|
if(info->targetGroup == targets && value >= info->targetValue) {
|
||||||
SetProgress(info->target);
|
SetProgress(info->targetValue);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user