1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
From d437a5a6e57cb27bca6685cd88186fd97c372ef8 Mon Sep 17 00:00:00 2001
From: Chaosvolt <chaosvolt@users.noreply.github.com>
Date: Thu, 23 Nov 2023 16:31:11 -0600
Subject: [PATCH 154/318] fix(balance): no more EXP gain when a skill is maxed
out (#3720)
---
src/character.cpp | 2 +-
src/skill.cpp | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/character.cpp b/src/character.cpp
index 6d8d9335c9c..707cce4f12d 100644
--- a/src/character.cpp
+++ b/src/character.cpp
@@ -3920,7 +3920,7 @@ void Character::practice( const skill_id &id, int amount, int cap, bool suppress
if( !level.can_train() && !in_sleep_state() ) {
// If leveling is disabled, don't train, don't drain focus, don't print anything
- // Leaving as a skill method rather than global for possible future skill cap setting
+ // This also checks if your skill level is maxed out at the cap of 10.
return;
}
diff --git a/src/skill.cpp b/src/skill.cpp
index 8964c80487f..5404cb204b1 100644
--- a/src/skill.cpp
+++ b/src/skill.cpp
@@ -9,6 +9,7 @@
#include "cata_utility.h"
#include "debug.h"
+#include "game_constants.h"
#include "item.h"
#include "json.h"
#include "options.h"
@@ -310,7 +311,7 @@ void SkillLevel::readBook( int minimumGain, int maximumGain, int maximumLevel )
bool SkillLevel::can_train() const
{
- return get_option<float>( "SKILL_TRAINING_SPEED" ) > 0.0;
+ return ( get_option<float>( "SKILL_TRAINING_SPEED" ) > 0.0 && _level < MAX_SKILL );
}
const SkillLevel &SkillLevelMap::get_skill_level_object( const skill_id &ident ) const
--
2.42.0
|