no longer checking whether unsigned integers are negative...

This commit is contained in:
myT 2022-05-26 22:22:45 +02:00
parent 15d457adb0
commit 4b131f258c
2 changed files with 3 additions and 5 deletions

View file

@ -1159,7 +1159,7 @@ bot_matchpiece_t *BotLoadMatchPieces(source_t *source, char *endtoken)
{
if (token.type == TT_NUMBER && (token.subtype & TT_INTEGER))
{
if (token.intvalue < 0 || token.intvalue >= MAX_MATCHVARIABLES)
if (token.intvalue >= MAX_MATCHVARIABLES)
{
SourceError(source, "can't have more than %d match variables\n", MAX_MATCHVARIABLES);
FreeSource(source);

View file

@ -1127,8 +1127,7 @@ void CL_MapDownload_Cancel()
// negative if nothing's going on
static float CL_MapDownload_Progress()
{
if (!CL_MapDownload_Active() || !cl_mapDL.fromCommand ||
cl_mapDL.bytesTotal < 1 || cl_mapDL.bytesDownloaded < 0)
if (!CL_MapDownload_Active() || !cl_mapDL.fromCommand || cl_mapDL.bytesTotal < 1)
return -1;
const uint64_t t = (uint64_t)cl_mapDL.bytesTotal;
@ -1143,8 +1142,7 @@ static float CL_MapDownload_Progress()
// bytes/s, negative if nothing's going on
static int CL_MapDownload_Speed()
{
if (!CL_MapDownload_Active() || !cl_mapDL.fromCommand ||
cl_mapDL.bytesTotal < 1 || cl_mapDL.bytesDownloaded < 0)
if (!CL_MapDownload_Active() || !cl_mapDL.fromCommand || cl_mapDL.bytesTotal < 1)
return -1;
const int startMS = cl_mapDL.startTimeMS;