Skip to content

Commit

Permalink
Nicer error message
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/version.h
  • Loading branch information
MeridianOXC authored and SupSuper committed Dec 31, 2019
1 parent 26288b9 commit 3ad3783
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Mod/ExtraSprites.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,12 @@ Surface *ExtraSprites::getFrame(SurfaceSet *set, int index) const
}
indexWithOffset += _current->offset;
}
else if (indexWithOffset < 0)
{
std::ostringstream err;
err << "ExtraSprites '" << _type << "' frame '" << indexWithOffset << "' in mod '" << _current->name << "' is not allowed.";
throw Exception(err.str());
}

Surface *frame = set->getFrame(indexWithOffset);
if (frame)
Expand Down

0 comments on commit 3ad3783

Please sign in to comment.