mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08: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];
|
||||
|
||||
int CommitFromX = max(X + pConf->m_StartX, 0);
|
||||
int CommitFromY = max(Y + pConf->m_StartY, 0);
|
||||
int CommitToX = min(X + Width + pConf->m_EndX, pLayer->m_Width);
|
||||
int CommitToY = min(Y + Height + pConf->m_EndY, pLayer->m_Height);
|
||||
int CommitFromX = clamp(X + pConf->m_StartX, 0, pLayer->m_Width);
|
||||
int CommitFromY = clamp(Y + pConf->m_StartY, 0, pLayer->m_Height);
|
||||
int CommitToX = clamp(X + Width + pConf->m_EndX, 0, pLayer->m_Width);
|
||||
int CommitToY = clamp(Y + Height + pConf->m_EndY, 0, pLayer->m_Height);
|
||||
|
||||
int UpdateFromX = max(X + 3 * pConf->m_StartX, 0);
|
||||
int UpdateFromY = max(Y + 3 * pConf->m_StartY, 0);
|
||||
int UpdateToX = min(X + Width + 3 * pConf->m_EndX, pLayer->m_Width);
|
||||
int UpdateToY = min(Y + Height + 3 * pConf->m_EndY, pLayer->m_Height);
|
||||
int UpdateFromX = clamp(X + 3 * pConf->m_StartX, 0, pLayer->m_Width);
|
||||
int UpdateFromY = clamp(Y + 3 * pConf->m_StartY, 0, pLayer->m_Height);
|
||||
int UpdateToX = clamp(X + Width + 3 * pConf->m_EndX, 0, pLayer->m_Width);
|
||||
int UpdateToY = clamp(Y + Height + 3 * pConf->m_EndY, 0, pLayer->m_Height);
|
||||
|
||||
CLayerTiles *pUpdateLayer;
|
||||
if (UpdateFromX != 0 || UpdateFromY != 0 || UpdateToX != pLayer->m_Width || UpdateToY != pLayer->m_Width)
|
||||
|
|
|
@ -432,8 +432,7 @@ void CLayerTiles::BrushDraw(CLayer *pBrush, float wx, float wy)
|
|||
|
||||
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);
|
||||
}
|
||||
|
||||
void CLayerTiles::BrushFlipX()
|
||||
|
|
Loading…
Reference in a new issue