Fixed: fixed a crash when determining sprite angles when there was more than one sprite for the same frame and angle.

This commit is contained in:
MaxED 2016-04-10 21:04:27 +00:00
parent 06d7209871
commit 8bac02ed14

View file

@ -564,21 +564,28 @@ namespace CodeImp.DoomBuilder.Config
return;
}
// Sanity checks
if(targetangle == 0)
{
General.ErrorLogger.Add(ErrorType.Warning, "Warning: actor \"" + title + "\":" + index + ", sprite \"" + sourcename + "\", frame " + targetframe + " has both rotated and non-rotated versions");
continue;
}
// More sanity checks
if(targetangle < 1 || targetangle > 8)
{
General.ErrorLogger.Add(ErrorType.Error, "Error in actor \"" + title + "\":" + index + ", sprite \"" + s + "\". Expected sprite angle in [1..8] range");
return;
}
// Even more sanity checks
if(!string.IsNullOrEmpty(frames[targetangle - 1]))
General.ErrorLogger.Add(ErrorType.Warning, "Warning in actor \"" + title + "\":" + index + ". Sprite \"" + sourcename + "\", frame " + targetframe + ", angle " + targetangle + " is double-defined");
else
processedcount++;
// Add to collection
frames[targetangle - 1] = s;
processedcount++;
}
// Check second frame block?
@ -596,22 +603,29 @@ namespace CodeImp.DoomBuilder.Config
return;
}
// Sanity checks
if(targetangle == 0)
{
General.ErrorLogger.Add(ErrorType.Warning, "Warning: actor \"" + title + "\":" + index + ", sprite \"" + sourcename + "\", frame " + targetframe + " has both rotated and non-rotated versions");
continue;
}
// More sanity checks
if(targetangle < 1 || targetangle > 8)
{
General.ErrorLogger.Add(ErrorType.Error, "Error in actor \"" + title + "\":" + index + ", sprite \"" + s + "\". Expected sprite angle in [1..8] range");
return;
}
// Even more sanity checks
if(!string.IsNullOrEmpty(frames[targetangle - 1]))
General.ErrorLogger.Add(ErrorType.Warning, "Warning in actor \"" + title + "\":" + index + ". Sprite \"" + sourcename + "\", frame " + targetframe + ", angle " + targetangle + " is double-defined");
else
processedcount++;
// Add to collections
frames[targetangle - 1] = s;
mirror[targetangle - 1] = true;
processedcount++;
}
// Gathered all sprites?