From f403d6234cf77300b437deb188ec452477a8e721 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Fri, 8 Jan 2016 01:33:39 +0000 Subject: [PATCH] C-CON: Add ifvarge, ifvarle, and ifvarboth in line with ifvarvarge, ifvarvarle, and ifvarvarboth. git-svn-id: https://svn.eduke32.com/eduke32@5530 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/gamedef.c | 6 ++++++ polymer/eduke32/source/gamedef.h | 3 +++ polymer/eduke32/source/gameexec.c | 18 ++++++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index fe1e98709..fc9227912 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -568,6 +568,9 @@ const char *keyw[] = "whilevarl", // 389 "whilevarvarl", // 390 "klabs", // 391 + "ifvarle", // 392 + "ifvarge", // 393 + "ifvarboth", // 394 "" }; #endif @@ -4479,12 +4482,15 @@ DO_DEFSTATE: continue; case CON_IFVARL: + case CON_IFVARLE: case CON_IFVARG: + case CON_IFVARGE: case CON_IFVARE: case CON_IFVARN: case CON_IFVARAND: case CON_IFVAROR: case CON_IFVARXOR: + case CON_IFVARBOTH: case CON_IFVAREITHER: case CON_WHILEVARN: case CON_WHILEVARL: diff --git a/polymer/eduke32/source/gamedef.h b/polymer/eduke32/source/gamedef.h index 7e10ca1ca..3f5d94d5e 100644 --- a/polymer/eduke32/source/gamedef.h +++ b/polymer/eduke32/source/gamedef.h @@ -1059,6 +1059,9 @@ enum ScriptKeywords_t CON_WHILEVARL, // 389 CON_WHILEVARVARL, // 390 CON_KLABS, // 391 + CON_IFVARLE, // 392 + CON_IFVARGE, // 393 + CON_IFVARBOTH, // 394 CON_END }; // KEEPINSYNC with the keyword list in lunatic/con_lang.lua diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 441b935ca..679c3af2b 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -5256,18 +5256,36 @@ finish_qsprintf: VM_CONDITIONAL(tw || *insptr); continue; + case CON_IFVARBOTH: + insptr++; + tw = Gv_GetVarX(*insptr++); + VM_CONDITIONAL(tw && *insptr); + continue; + case CON_IFVARG: insptr++; tw = Gv_GetVarX(*insptr++); VM_CONDITIONAL(tw > *insptr); continue; + case CON_IFVARGE: + insptr++; + tw = Gv_GetVarX(*insptr++); + VM_CONDITIONAL(tw >= *insptr); + continue; + case CON_IFVARL: insptr++; tw = Gv_GetVarX(*insptr++); VM_CONDITIONAL(tw < *insptr); continue; + case CON_IFVARLE: + insptr++; + tw = Gv_GetVarX(*insptr++); + VM_CONDITIONAL(tw <= *insptr); + continue; + case CON_IFPHEALTHL: insptr++; VM_CONDITIONAL(sprite[ps->i].extra < *insptr);