Skip to content

Commit 6745490

Browse files
committed
#1861 fixed out of bounds access
1 parent 63996ca commit 6745490

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

game/player.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,7 +1944,7 @@ QPoint Player::getRockettarget(qint32 radius, qint32 damage, qreal ownUnitValue,
19441944
}
19451945
}
19461946

1947-
if (targets.size() >= 0)
1947+
if (targets.size() > 0)
19481948
{
19491949
return targets[GlobalUtils::randInt(0, targets.size() - 1)];
19501950
}
@@ -1999,7 +1999,7 @@ QPoint Player::getSiloRockettarget(qint32 radius, qint32 damage, qint32 & highes
19991999
}
20002000
}
20012001
}
2002-
if (targets.size() >= 0)
2002+
if (targets.size() > 0)
20032003
{
20042004
return targets[GlobalUtils::randInt(0, targets.size() - 1)];
20052005
}

0 commit comments

Comments
 (0)