From f3f72f34db4565e5ccec4ccb307b60cf8a6cfd83 Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 3 Sep 2024 18:42:26 +0100 Subject: [PATCH] Cleaned up nullguard and comments --- project/src/helpers/HealthHelper.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/project/src/helpers/HealthHelper.ts b/project/src/helpers/HealthHelper.ts index 214b3939..c5552959 100644 --- a/project/src/helpers/HealthHelper.ts +++ b/project/src/helpers/HealthHelper.ts @@ -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") {