Fix a crash issue when attempting to draw invalid item.

This can happen when using UIItem as interfaces etc.
This commit is contained in:
BenDol
2014-07-11 16:19:30 +12:00
parent 12b3bd4ee0
commit 9f7aafac0b
3 changed files with 23 additions and 19 deletions

View File

@@ -272,6 +272,10 @@ ItemPtr Item::clone()
void Item::calculatePatterns(int& xPattern, int& yPattern, int& zPattern)
{
// Avoid crashes with invalid items
if(!isValid())
return;
if(isStackable() && getNumPatternX() == 4 && getNumPatternY() == 2) {
if(m_countOrSubType <= 0) {
xPattern = 0;