Skip to content
Permalink
Browse files

Fix #1135 - bitExtract is broken (client side)

  • Loading branch information...
ccw808 committed Oct 26, 2019
1 parent d112011 commit aa2df39d3e40e5b446ffea376ef96df89916a9d0
Showing with 9 additions and 3 deletions.
  1. +9 −3 Shared/sdk/CScriptArgReader.h
@@ -64,12 +64,18 @@ class CScriptArgReader
if (std::isnan(number))
{
SetCustomError("Expected number, got NaN", "Bad argument");
outValue = 0;
return;
}

if (checkSign && std::is_unsigned<T>() && number < -FLT_EPSILON)
if (std::is_unsigned<T>())
{
SetCustomWarning("Expected positive value, got negative. This warning may be an error in future versions.");
if (checkSign && number < -FLT_EPSILON)
{
SetCustomWarning("Expected positive value, got negative. This warning may be an error in future versions.");
}
outValue = static_cast<T>(static_cast<int64_t>(number));
return;
}

outValue = static_cast<T>(number);
@@ -102,6 +108,7 @@ class CScriptArgReader
if (std::isnan(number))
{
SetCustomError("Expected number, got NaN", "Bad argument");
outValue = 0;
return;
}

@@ -111,7 +118,6 @@ class CScriptArgReader
}

outValue = static_cast<T>(number);

return;
}
else if (iArgument == LUA_TNONE || iArgument == LUA_TNIL)

0 comments on commit aa2df39

Please sign in to comment.
You can’t perform that action at this time.