From d55b9473ec498ae181b3c91583c6950e4c3bb7f2 Mon Sep 17 00:00:00 2001 From: fusion32 Date: Tue, 19 Aug 2025 22:41:08 -0300 Subject: fix a problem with monsters freezing after failing to attack --- src/crskill.cc | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'src/crskill.cc') 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; } -- cgit v1.2.3