Skip to content

Commit

Permalink
Fix #1043: Change bad numberstring warning to error
Browse files Browse the repository at this point in the history
  • Loading branch information
patrikjuvonen committed Dec 24, 2022
1 parent 01847e0 commit 9baf6a5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Shared/sdk/CScriptArgReader.h
Expand Up @@ -59,7 +59,8 @@ class CScriptArgReader
// The string received may not actually be a number
if (!lua_isnumber(m_luaVM, m_iIndex))
{
SetCustomWarning("Expected number, got non-convertible string. This warning may be an error in future versions.");
SetCustomError("Expected number, got non-convertible string", "Bad argument");
return;
}

// Returns 0 even if the string cannot be parsed as a number
Expand Down Expand Up @@ -103,7 +104,8 @@ class CScriptArgReader
// The string received may not actually be a number
if (!lua_isnumber(m_luaVM, m_iIndex))
{
SetCustomWarning("Expected number, got non-convertible string. This warning may be an error in future versions.");
SetCustomError("Expected number, got non-convertible string", "Bad argument");
return;
}

// Returns 0 even if the string cannot be parsed as a number
Expand Down

0 comments on commit 9baf6a5

Please sign in to comment.