mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 11:10:39 +00:00
Attempting to compile a CON with something stupid like "mul var 0" or "div var 0" in it now throws an error
git-svn-id: https://svn.eduke32.com/eduke32@7270 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
2be7afd33c
commit
3d4d640be3
1 changed files with 10 additions and 2 deletions
|
@ -3735,10 +3735,18 @@ setvar:
|
|||
|
||||
C_GetNextVarType(GAMEVAR_READONLY);
|
||||
C_GetNextValue(LABEL_DEFINE);
|
||||
if (tw == CON_DIVVAR || tw == CON_MULVAR)
|
||||
|
||||
// replace divides and multiplies by 0 with an error asking if the user is stupid
|
||||
if (ins[2] == 0 && (tw == CON_MODVAR || tw == CON_MULVAR || tw == CON_DIVVAR))
|
||||
{
|
||||
g_errorCnt++;
|
||||
C_ReportError(-1);
|
||||
initprintf("%s:%d: error: divide or multiply by zero! What are you doing?\n", g_scriptFileName, g_lineNumber);
|
||||
continue;
|
||||
}
|
||||
else if (tw == CON_DIVVAR || tw == CON_MULVAR)
|
||||
{
|
||||
auto const i = ins[2];
|
||||
|
||||
// replace multiplies or divides by 1 with nullop
|
||||
if (i == 1)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue