Warn when a sprite operation is to be performed on a nonexistent surface instead of crashing

svn-id: r41499
This commit is contained in:
Sven Hesse 2009-06-13 22:35:22 +00:00
parent 7eaf013bbf
commit acb0de6580

View file

@ -705,6 +705,11 @@ void Draw_v2::spriteOperation(int16 operation) {
sourceSurf = _spritesArray[_sourceSurface];
destSurf = _spritesArray[_destSurface];
if (!destSurf) {
warning("Can't do operation %d on surface %d: nonexistent", operation, _destSurface);
return;
}
switch (operation) {
case DRAW_BLITSURF:
case DRAW_DRAWLETTER: