mirror of
https://github.com/edubart/otclient.git
synced 2025-10-16 04:24:54 +02:00
Fix a crash issue when attempting to draw invalid item.
This can happen when using UIItem as interfaces etc.
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user