mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-14 03:58:18 +00:00
Nicer fix for crash
This commit is contained in:
parent
1c85c962ef
commit
16f6e23aaa
|
@ -365,15 +365,15 @@ void CAutoMapper::ProceedLocalized(CLayerTiles *pLayer, int ConfigID, int Seed,
|
||||||
|
|
||||||
CConfiguration *pConf = &m_lConfigs[ConfigID];
|
CConfiguration *pConf = &m_lConfigs[ConfigID];
|
||||||
|
|
||||||
int CommitFromX = max(X + pConf->m_StartX, 0);
|
int CommitFromX = clamp(X + pConf->m_StartX, 0, pLayer->m_Width);
|
||||||
int CommitFromY = max(Y + pConf->m_StartY, 0);
|
int CommitFromY = clamp(Y + pConf->m_StartY, 0, pLayer->m_Height);
|
||||||
int CommitToX = min(X + Width + pConf->m_EndX, pLayer->m_Width);
|
int CommitToX = clamp(X + Width + pConf->m_EndX, 0, pLayer->m_Width);
|
||||||
int CommitToY = min(Y + Height + pConf->m_EndY, pLayer->m_Height);
|
int CommitToY = clamp(Y + Height + pConf->m_EndY, 0, pLayer->m_Height);
|
||||||
|
|
||||||
int UpdateFromX = max(X + 3 * pConf->m_StartX, 0);
|
int UpdateFromX = clamp(X + 3 * pConf->m_StartX, 0, pLayer->m_Width);
|
||||||
int UpdateFromY = max(Y + 3 * pConf->m_StartY, 0);
|
int UpdateFromY = clamp(Y + 3 * pConf->m_StartY, 0, pLayer->m_Height);
|
||||||
int UpdateToX = min(X + Width + 3 * pConf->m_EndX, pLayer->m_Width);
|
int UpdateToX = clamp(X + Width + 3 * pConf->m_EndX, 0, pLayer->m_Width);
|
||||||
int UpdateToY = min(Y + Height + 3 * pConf->m_EndY, pLayer->m_Height);
|
int UpdateToY = clamp(Y + Height + 3 * pConf->m_EndY, 0, pLayer->m_Height);
|
||||||
|
|
||||||
CLayerTiles *pUpdateLayer;
|
CLayerTiles *pUpdateLayer;
|
||||||
if (UpdateFromX != 0 || UpdateFromY != 0 || UpdateToX != pLayer->m_Width || UpdateToY != pLayer->m_Width)
|
if (UpdateFromX != 0 || UpdateFromY != 0 || UpdateToX != pLayer->m_Width || UpdateToY != pLayer->m_Width)
|
||||||
|
|
|
@ -432,7 +432,6 @@ void CLayerTiles::BrushDraw(CLayer *pBrush, float wx, float wy)
|
||||||
|
|
||||||
SetTile(fx, fy, l->m_pTiles[y*l->m_Width+x]);
|
SetTile(fx, fy, l->m_pTiles[y*l->m_Width+x]);
|
||||||
}
|
}
|
||||||
if(sx >= 0 && sx + l->m_Width < m_Width && sy >= 0 && sy + l->m_Height < m_Height)
|
|
||||||
FlagModified(sx, sy, l->m_Width, l->m_Height);
|
FlagModified(sx, sy, l->m_Width, l->m_Height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue