Fix some UBs

This commit is contained in:
erorcun
2021-01-29 01:44:33 +03:00
parent 7056f9954f
commit 810bad9fd8
8 changed files with 36 additions and 21 deletions

View File

@@ -859,7 +859,7 @@ CPathFind::PreparePathDataForType(uint8 type, CTempNode *tempnodes, CPathInfoFor
mag = Sqrt(dx*dx + dy*dy);
dx /= mag;
dy /= mag;
int width = Max(m_pathNodes[i].width, m_pathNodes[j].width);
uint8 width = Max(m_pathNodes[i].width, m_pathNodes[j].width);
if(i < j){
dx = -dx;
dy = -dy;