mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-19 13:58:14 +00:00
fix: Don't only store properties visited as the cloneID
This commit is contained in:
@@ -620,3 +620,17 @@ bool MissionComponent::HasCollectible(int32_t collectibleID) {
|
||||
bool MissionComponent::HasMission(uint32_t missionId) {
|
||||
return GetMission(missionId) != nullptr;
|
||||
}
|
||||
|
||||
void MissionComponent::FixPropertyVistingMissions(){
|
||||
auto missionIDsToCheck = {1199, 1200, 1201, 1202, 1739};
|
||||
for (auto& missionID : missionIDsToCheck){
|
||||
auto mission = GetMission(missionID);
|
||||
if (!mission || mission->GetMissionState() == eMissionState::COMPLETE) continue;
|
||||
auto tasks = mission->GetTasks();
|
||||
if (tasks.empty()) continue;;
|
||||
for (auto& task :tasks) {
|
||||
task->SetProgress(0, false);
|
||||
task->SetUnique();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -170,6 +170,11 @@ public:
|
||||
*/
|
||||
bool HasMission(uint32_t missionId);
|
||||
|
||||
/**
|
||||
* Clears property visitng missions if they have not been completed
|
||||
*/
|
||||
void FixPropertyVistingMissions();
|
||||
|
||||
private:
|
||||
/**
|
||||
* All the missions owned by this entity, mapped by mission ID
|
||||
|
@@ -332,12 +332,12 @@ void MissionTask::Progress(int32_t value, LWOOBJID associate, const std::string&
|
||||
case eMissionTaskType::VISIT_PROPERTY:
|
||||
{
|
||||
if (!InAllTargets(value)) break;
|
||||
|
||||
if (std::find(unique.begin(), unique.end(), static_cast<uint32_t>(associate)) != unique.end()) break;
|
||||
uint64_t key = (static_cast<uint64_t>(value) << 31U) | associate;
|
||||
if (std::find(unique.begin(), unique.end(), static_cast<uint32_t>(key)) != unique.end()) break;
|
||||
|
||||
AddProgress(count);
|
||||
|
||||
unique.push_back(associate);
|
||||
unique.push_back(key);
|
||||
|
||||
break;
|
||||
}
|
||||
|
@@ -87,7 +87,7 @@ public:
|
||||
* Sets the uniquely visited list of locations
|
||||
* @param value the uniquely visited list of locations
|
||||
*/
|
||||
void SetUnique(const std::vector<uint32_t>& value);
|
||||
void SetUnique(const std::vector<uint32_t>& value = {});
|
||||
|
||||
/**
|
||||
* Returns the possibly target values for this mission task for progression
|
||||
|
Reference in New Issue
Block a user