Skip to content

Commit 1cd1b61

Browse files
committed
Fix #1070: Change unsigned type check from warning to error
1 parent 9baf6a5 commit 1cd1b61

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Shared/sdk/CScriptArgReader.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ class CScriptArgReader
7777
{
7878
if (checkSign && number < -FLT_EPSILON)
7979
{
80-
SetCustomWarning("Expected positive value, got negative. This warning may be an error in future versions.");
80+
SetCustomError("Expected positive value, got negative", "Bad argument");
81+
return;
8182
}
8283
outValue = static_cast<T>(static_cast<int64_t>(number));
8384
return;
@@ -120,7 +121,8 @@ class CScriptArgReader
120121

121122
if (checkSign && std::is_unsigned<T>() && number < -FLT_EPSILON)
122123
{
123-
SetCustomWarning("Expected positive value, got negative. This warning may be an error in future versions.");
124+
SetCustomError("Expected positive value, got negative", "Bad argument");
125+
return;
124126
}
125127

126128
outValue = static_cast<T>(number);

0 commit comments

Comments
 (0)