From 3ae519771b1183b47c16b5ee137722f77fa000f9 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Thu, 8 Sep 2005 19:56:38 +0000
Subject: [PATCH] Bugfix: Baja integer manipulation functions (e.g.
 ADD,SUB,MUL,DIV,AND, etc.) did not work if the second argument was a string
 variable.

---
 src/sbbs3/execmisc.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/sbbs3/execmisc.cpp b/src/sbbs3/execmisc.cpp
index 2d6f05fd37..1e22a908e2 100644
--- a/src/sbbs3/execmisc.cpp
+++ b/src/sbbs3/execmisc.cpp
@@ -653,9 +653,6 @@ int sbbs_t::exec_misc(csi_t* csi, char *path)
 					lp1=getintvar(csi,*(long *)csi->ip);
 					csi->ip+=4;
 					lp2=getintvar(csi,*(long *)csi->ip);
-					csi->ip+=4;
-					if(!lp1)
-						return(0);
 					if(!lp2) {
 						pp=getstrvar(csi,*(long *)csi->ip);
 						if(!pp || !*pp)
@@ -663,6 +660,9 @@ int sbbs_t::exec_misc(csi_t* csi, char *path)
 						l=strtol(*pp,0,0); }
 					else
 						l=*lp2;
+					csi->ip+=4;
+					if(!lp1)
+						return(0);
 					switch(i) {
 						case ADD_INT_VARS:
 							*lp1+=l;
-- 
GitLab