Permalink
Browse files

Actor::GetBaseCasterLevel: log a message for funky spell types

  • Loading branch information...
1 parent 748e2cf commit 831ed152a23c3564a9ddc4b5648c6c5d6fe34064 @lynxlynxlynx lynxlynxlynx committed Jan 12, 2014
Showing with 7 additions and 0 deletions.
  1. +7 −0 gemrb/core/Scriptable/Actor.cpp
@@ -4386,13 +4386,20 @@ ieDword Actor::GetBaseCasterLevel(int spelltype, int flags) const
level = GetClericLevel();
if (!level) level = GetDruidLevel();
if (!level) level = GetPaladinLevel();
+ // for cleric/rangers, we can't tell from which class a spell is, unless unique, so we ignore the distinction
if (!level) level = GetRangerLevel();
break;
case IE_SPL_WIZARD:
level = GetMageLevel();
if (!level) level = GetSorcererLevel();
if (!level) level = GetBardLevel();
break;
+ default:
+ // checking if anyone uses the psion, item and song types
+ if (spelltype != IE_SPL_INNATE) {
+ Log(ERROR, "Actor", "Unhandled SPL type: %d!", spelltype);
+ }
+ break;
}
// if nothing was found, use the average level
if (!level && !flags) level = GetXPLevel(true);

0 comments on commit 831ed15

Please sign in to comment.