From 73cfc166995c5604746e25bdf036f7f380488f3f Mon Sep 17 00:00:00 2001 From: Dev Date: Mon, 11 Dec 2023 11:45:23 +0000 Subject: [PATCH] Prevent giving player 0 intellect skill points when crafting in hideout --- project/src/controllers/HideoutController.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/project/src/controllers/HideoutController.ts b/project/src/controllers/HideoutController.ts index cfb5af65..9867a932 100644 --- a/project/src/controllers/HideoutController.ts +++ b/project/src/controllers/HideoutController.ts @@ -864,15 +864,21 @@ export class HideoutController globals.config.SkillsSettings.HideoutManagement.SkillPointsPerCraft, true, ); - // manager Crafting skill + // Manager Crafting skill if (craftingExpAmount > 0) { this.profileHelper.addSkillPointsToPlayer(pmcData, SkillTypes.CRAFTING, craftingExpAmount); - this.profileHelper.addSkillPointsToPlayer( - pmcData, - SkillTypes.INTELLECT, - 0.5 * (Math.round(craftingExpAmount / 15)), - ); + + const intellectAmountToGive = 0.5 * (Math.round(craftingExpAmount / 15)); + if (intellectAmountToGive > 0) + { + this.profileHelper.addSkillPointsToPlayer( + pmcData, + SkillTypes.INTELLECT, + intellectAmountToGive, + ); + } + } area.lastRecipe = request.recipeId; counterHoursCrafting.value = hoursCrafting;