aboutsummaryrefslogtreecommitdiff
path: root/src/crskill.cc
diff options
context:
space:
mode:
authorfusion32 <marcopuzziello@gmail.com>2025-08-19 22:41:08 -0300
committerfusion32 <marcopuzziello@gmail.com>2025-08-19 22:41:08 -0300
commitd55b9473ec498ae181b3c91583c6950e4c3bb7f2 (patch)
tree6f0b2dc1504c037f774868b549fe00fc2945b99d /src/crskill.cc
parentb2a9d2cb961fabc1ca05052a645d90663d8e0a92 (diff)
downloadgame-d55b9473ec498ae181b3c91583c6950e4c3bb7f2.tar.gz
game-d55b9473ec498ae181b3c91583c6950e4c3bb7f2.zip
fix a problem with monsters freezing after failing to attack
Diffstat (limited to 'src/crskill.cc')
-rw-r--r--src/crskill.cc17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/crskill.cc b/src/crskill.cc
index 092e701..27655a9 100644
--- a/src/crskill.cc
+++ b/src/crskill.cc
@@ -480,20 +480,13 @@ int TSkillProbe::GetExpForLevel(int Level){
return 0;
}
- // TODO(fusion): This part of the decompiled code was a bit weird. I had to
- // look into the disassembly to figure the string parameter of `error` below
- // and it is weird that we keep going even with invalid values of `FactorPercent`.
int FactorPercent = this->FactorPercent;
- if(FactorPercent < 1000){
- const char *MasterName = "---";
- if(this->Master != NULL){
- MasterName = this->Master->Name;
- }
- error("TSkillProbe::GetExpForLevel: Ungültiger FactorPercent-Wert %d bei %s.\n", FactorPercent, MasterName);
- }
-
if(FactorPercent < 1050){
- error("TSkillProbe::GetExpForLevel: Ungültiger FactorPercent-Wert %d. Rechne mit 1000 weiter.\n", FactorPercent);
+ if(FactorPercent != 1000){
+ const char *MasterName = (this->Master != NULL ? this->Master->Name : "---");
+ error("TSkillProbe::GetExpForLevel: Ungültiger FactorPercent-Wert %d bei %s."
+ " Rechne mit 1000 weiter.\n", FactorPercent, MasterName);
+ }
return (Level - this->Min) * this->Delta;
}