Fix crash introduced by 1e2dce0. Close #1362

This commit is contained in:
Learath 2018-10-30 18:13:32 +01:00
parent aab6fa152a
commit 0ecda0ced4

View file

@ -364,9 +364,7 @@ int CLayerTiles::BrushGrab(CLayerGroup *pBrush, CUIRect Rect)
void CLayerTiles::FillSelection(bool Empty, CLayer *pBrush, CUIRect Rect)
{
if(m_Readonly)
return;
if(pBrush->m_Type != LAYERTYPE_TILES)
if(m_Readonly || Empty || pBrush->m_Type != LAYERTYPE_TILES)
return;
Snap(&Rect);
@ -1015,9 +1013,7 @@ void CLayerTele::BrushRotate(float Amount)
void CLayerTele::FillSelection(bool Empty, CLayer *pBrush, CUIRect Rect)
{
if(m_Readonly)
return;
if(pBrush->m_Type != LAYERTYPE_TILES)
if(m_Readonly || Empty || pBrush->m_Type != LAYERTYPE_TILES)
return;
Snap(&Rect); // corrects Rect; no need of <=
@ -1282,9 +1278,7 @@ void CLayerSpeedup::BrushRotate(float Amount)
void CLayerSpeedup::FillSelection(bool Empty, CLayer *pBrush, CUIRect Rect)
{
if(m_Readonly)
return;
if(pBrush->m_Type != LAYERTYPE_TILES)
if(m_Readonly || Empty || pBrush->m_Type != LAYERTYPE_TILES)
return;
Snap(&Rect); // corrects Rect; no need of <=
@ -1561,9 +1555,7 @@ void CLayerSwitch::BrushDraw(CLayer *pBrush, float wx, float wy)
void CLayerSwitch::FillSelection(bool Empty, CLayer *pBrush, CUIRect Rect)
{
if(m_Readonly)
return;
if(pBrush->m_Type != LAYERTYPE_TILES)
if(m_Readonly || Empty || pBrush->m_Type != LAYERTYPE_TILES)
return;
Snap(&Rect); // corrects Rect; no need of <=
@ -1825,9 +1817,7 @@ void CLayerTune::BrushRotate(float Amount)
void CLayerTune::FillSelection(bool Empty, CLayer *pBrush, CUIRect Rect)
{
if(m_Readonly)
return;
if(pBrush->m_Type != LAYERTYPE_TILES)
if(m_Readonly || Empty || pBrush->m_Type != LAYERTYPE_TILES)
return;
Snap(&Rect); // corrects Rect; no need of <=