From 3c5000d1a85f2a818f2c7a5aad65b42858cc38d7 Mon Sep 17 00:00:00 2001 From: Pavel Solodovnikov Date: Thu, 18 Apr 2024 16:56:11 +0300 Subject: [PATCH] campaign: Don't allow picking up a single artifact multiple times in `__camPickupArtifact` Signed-off-by: Pavel Solodovnikov --- data/base/script/campaign/libcampaign_includes/artifact.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/data/base/script/campaign/libcampaign_includes/artifact.js b/data/base/script/campaign/libcampaign_includes/artifact.js index 9a07bcfcb79..cc29d32f645 100644 --- a/data/base/script/campaign/libcampaign_includes/artifact.js +++ b/data/base/script/campaign/libcampaign_includes/artifact.js @@ -150,6 +150,12 @@ function __camPickupArtifact(artifact) camTrace("Artifact", artifact.id, "is not managed"); return; } + if (Object.hasOwn(ai, "pickedUp") && ai.pickedUp === true) + { + camTrace("Already picked up the artifact", __ALABEL); + return; + } + ai.pickedUp = true; camTrace("Picked up", ai.tech); playSound(cam_sounds.artifactRecovered, artifact.x, artifact.y, artifact.z);