From 8ae234aedf6bdf5ae5927405adf45b85cf74f6fe Mon Sep 17 00:00:00 2001 From: Uleat Date: Tue, 11 Nov 2014 00:11:44 -0500 Subject: [PATCH] Real fix for GM trainer crash..evidently the problem went deeper than an undefined condition... --- changelog.txt | 2 +- zone/client_process.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/changelog.txt b/changelog.txt index 215ef1c09..4c90cd163 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,7 +1,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- == 11/10/2014 == -Uleat: Fix for GM Trainer crashing server +Uleat: Fix for GM Trainer crashing server (really!) == 11/09/2014 == Kayen: Implemented support for spell target type (45) 'Target Rings' on Underfoot (does work earlier expansions). Thanks to Lecht for figuring out the op_code side. diff --git a/zone/client_process.cpp b/zone/client_process.cpp index d9b2d9030..197562889 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -1611,12 +1611,11 @@ void Client::OPGMTraining(const EQApplicationPacket *app) if(DistNoRoot(*pTrainer) > USE_NPC_RANGE2) return; - SkillUseTypes sk; - for (sk = Skill1HBlunt; sk <= HIGHEST_SKILL; sk = (SkillUseTypes)(sk+1)) { + for (int sk = Skill1HBlunt; sk <= HIGHEST_SKILL; ++sk) { if(sk == SkillTinkering && GetRace() != GNOME) { gmtrain->skills[sk] = 0; //Non gnomes can't tinker! } else { - gmtrain->skills[sk] = GetMaxSkillAfterSpecializationRules(sk, MaxSkill(sk, GetClass(), RuleI(Character, MaxLevel))); + gmtrain->skills[sk] = GetMaxSkillAfterSpecializationRules((SkillUseTypes)sk, MaxSkill((SkillUseTypes)sk, GetClass(), RuleI(Character, MaxLevel))); //this is the highest level that the trainer can train you to, this is enforced clientside so we can't just //Set it to 1 with CanHaveSkill or you wont be able to train past 1. }