Cleaned up nullguard and comments

This commit is contained in:
Dev 2024-09-03 18:42:26 +01:00
parent 9d923a8b0e
commit f3f72f34db

View File

@ -141,11 +141,9 @@ export class HealthHelper {
const effectDetails = bodyPartEffects[effect];
// Null guard
if (!profileData.Health.BodyParts[bodyPartId].Effects) {
profileData.Health.BodyParts[bodyPartId].Effects = {};
}
profileData.Health.BodyParts[bodyPartId].Effects ||= {};
// Already exists on server profile, skip
// Effect already exists on limb in server profile, skip
const profileBodyPartEffects = profileData.Health.BodyParts[bodyPartId].Effects;
if (profileBodyPartEffects[effect]) {
if (effect === "Exhaustion") {