/// <summary> /// Check if <see cref="AchievementChecklistEntry"/> can be updated as <see cref="Player"/> with supplied object ids. /// </summary> private bool CanUpdateChecklist(Player player, AchievementChecklistEntry entry, uint objectId, uint objectIdAlt) { if (entry.PrerequisiteId != 0u && !PrerequisiteManager.Instance.Meets(player, entry.PrerequisiteId)) { return(false); } // no checklist entry has PrerequisiteIdAlt set if (entry.PrerequisiteIdAlt != 0u && !PrerequisiteManager.Instance.Meets(player, entry.PrerequisiteIdAlt)) { return(false); } if (entry.ObjectId != 0u && entry.ObjectId != objectId) { return(false); } if (entry.ObjectIdAlt != 0u && entry.ObjectIdAlt != objectIdAlt) { return(false); } // TODO: Research this case where both values are 0. It's assumed the checklist is checked by ID by a script. if (entry.ObjectId == 0u && entry.ObjectIdAlt == 0u) { return(false); } return(true); }
/// <summary> /// Check if <see cref="AchievementChecklistEntry"/> can be updated as <see cref="Player"/> with supplied object ids. /// </summary> private bool CanUpdateChecklist(Player player, AchievementChecklistEntry entry, uint objectId, uint objectIdAlt) { if (entry.PrerequisiteId != 0u && !PrerequisiteManager.Instance.Meets(player, entry.PrerequisiteId)) { return(false); } // no checklist entry has PrerequisiteIdAlt set if (entry.PrerequisiteIdAlt != 0u && !PrerequisiteManager.Instance.Meets(player, entry.PrerequisiteIdAlt)) { return(false); } if (entry.ObjectId != 0u && entry.ObjectId != objectId) { return(false); } if (entry.ObjectIdAlt != 0u && entry.ObjectIdAlt != objectIdAlt) { return(false); } return(true); }