m32script: fix parsing negated labels, getnumber* with neg. 'max'.

Exposed by this snippet from a.m32:
    getnumber256 .owner "OWNER (projection picnum): " -MAXTILES
Now, Alt+KP2 works as expected in 3D mode.

git-svn-id: https://svn.eduke32.com/eduke32@4196 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-12-11 21:23:47 +00:00
parent 44351528db
commit c323fac09d
3 changed files with 5 additions and 1 deletions

View file

@ -1274,7 +1274,7 @@ static void C_GetNextVarType(int32_t type)
{
// if (!(g_numCompilerErrors || g_numCompilerWarnings) && g_scriptDebug)
// initprintf("%s:%d: debug: accepted defined label `%s' instead of gamevar.\n",g_szScriptFileName,g_lineNumber,label+(id*MAXLABELLEN));
num = (1-!!(flags&M32_FLAG_NEGATE))*labelval[id];
num = (1-2*!!(flags&M32_FLAG_NEGATE))*labelval[id];
if (type==GV_SIMPLE && (num<0 || num>=65536))
{

View file

@ -2373,6 +2373,8 @@ badindex:
if (max==0)
max = INT32_MAX;
else
max = klabs(max);
//OSD_Printf("max:%d, sign:%d\n", max, sign);
if (tw==CON_GETNUMBERFROMUSER)

View file

@ -266,6 +266,8 @@ int32_t __fastcall Gv_GetVarX(register int32_t id)
if (id == M32_THISACTOR_VAR_ID)
return vm.g_i;
id &= ~M32_FLAG_NEGATE;
if ((id & M32_BITS_MASK) == M32_FLAG_CONSTANT)
{
switch (id&3)