From 36adc3c516084f64657054b16d854ab3a368ff40 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Mon, 25 Mar 2013 01:18:47 -0300 Subject: [PATCH 1/6] Fix NEUT not going through INVS --- src/simulation/Simulation.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index d59ac51c8..03f90a119 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -2116,6 +2116,7 @@ void Simulation::init_can_move() can_move[PT_ELEC][PT_BIZRG] = 2; can_move[PT_PHOT][PT_BIZRS] = 2; can_move[PT_ELEC][PT_BIZRS] = 2; + can_move[PT_NEUT][PT_INVIS] = 2; //whol eats anar can_move[PT_ANAR][PT_WHOL] = 1; From 9ef7a4c1a523e485c501d64644bfba9c1d7f3bb5 Mon Sep 17 00:00:00 2001 From: Saveliy Skresanov Date: Mon, 25 Mar 2013 20:09:55 +0700 Subject: [PATCH 2/6] Doxin's change to SConstruct for buildserv. --- SConstruct | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 1360e9fa4..81456fde4 100644 --- a/SConstruct +++ b/SConstruct @@ -1 +1,2 @@ -SConscript('SConscript', variant_dir='build', duplicate=0) +AddOption('--builddir',dest="builddir",default="build",help="Directory to build to.") +SConscript('SConscript', variant_dir=GetOption('builddir'), duplicate=0) From 010f7790ebc72baf1fa3c99dfaeb8b69cdd3a0cb Mon Sep 17 00:00:00 2001 From: jacob1 Date: Mon, 25 Mar 2013 12:36:04 -0300 Subject: [PATCH 3/6] Fix CRAY bug that deletes particle 0 --- src/simulation/elements/CRAY.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/simulation/elements/CRAY.cpp b/src/simulation/elements/CRAY.cpp index 38c3b9f8b..3cba72ae0 100644 --- a/src/simulation/elements/CRAY.cpp +++ b/src/simulation/elements/CRAY.cpp @@ -105,7 +105,7 @@ int Element_CRAY::update(UPDATE_FUNC_ARGS) colored = wavelengthToDecoColour(parts[r>>8].ctype); } else if ((r&0xFF) == PT_CRAY || nostop) { docontinue = 1; - } else if(destroy && ((r&0xFF) != PT_DMND)) { + } else if(destroy && r && ((r&0xFF) != PT_DMND)) { sim->kill_part(r>>8); if(!--partsRemaining) docontinue = 0; @@ -147,4 +147,4 @@ unsigned int Element_CRAY::wavelengthToDecoColour(int wavelength) } -Element_CRAY::~Element_CRAY() {} \ No newline at end of file +Element_CRAY::~Element_CRAY() {} From 0791f5b0f8c64252c3288d4612655370770dbc2c Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Tue, 26 Mar 2013 09:24:15 +0000 Subject: [PATCH 4/6] TPTScriptInterface: Ability to read hexadecimal constants --- src/cat/TPTScriptInterface.cpp | 58 +++++++++++++++++++++++++++++++++- src/cat/TPTScriptInterface.h | 1 + 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/src/cat/TPTScriptInterface.cpp b/src/cat/TPTScriptInterface.cpp index 84f55efb0..a6a386f6d 100644 --- a/src/cat/TPTScriptInterface.cpp +++ b/src/cat/TPTScriptInterface.cpp @@ -85,10 +85,22 @@ ValueType TPTScriptInterface::testType(std::string word) { if(rawWord[i] == ',' && rawWord[i+1] >= '0' && rawWord[i+1] <= '9') goto parsePoint; + else if((rawWord[i] == '#' || rawWord[i] == 'x') && + ((rawWord[i+1] >= '0' && rawWord[i+1] <= '9') + || (rawWord[i+1] >= 'a' && rawWord[i+1] <= 'f') + || (rawWord[i+1] >= 'A' && rawWord[i+1] <= 'F'))) + goto parseNumberHex; else goto parseString; } } + parseNumberHex: + i++; + for(; i < word.length(); i++) + if(!((rawWord[i] >= '0' && rawWord[i] <= '9') || (rawWord[i] >= 'a' && rawWord[i] <= 'f') || (rawWord[i] >= 'A' && rawWord[i] <= 'F'))) + { + goto parseString; + } return TypeNumber; parsePoint: i++; @@ -102,6 +114,50 @@ ValueType TPTScriptInterface::testType(std::string word) return TypeString; } +int TPTScriptInterface::parseNumber(char * stringData) +{ + char cc; + int base = 10; + int currentNumber = 0; + if(stringData[0] == '#') + { + stringData++; + base = 16; + } + else if(stringData[0] == '0' && stringData[1] == 'x') + { + stringData+=2; + base = 16; + } + if(base == 16) + { + while(cc = *(stringData++)) + { + currentNumber *= base; + if(cc >= '0' && cc <= '9') + currentNumber += cc - '0'; + else if(cc >= 'a' && cc <= 'f') + currentNumber += (cc - 'A') + 10; + else if(cc >= 'A' && cc <= 'F') + currentNumber += (cc - 'A') + 10; + else + break; + } + } + else + { + while(cc = *(stringData++)) + { + currentNumber *= base; + if(cc >= '0' && cc <= '9') + currentNumber += cc - '0'; + else + break; + } + } + return currentNumber; +} + AnyType TPTScriptInterface::eval(std::deque * words) { if(words->size() < 1) @@ -128,7 +184,7 @@ AnyType TPTScriptInterface::eval(std::deque * words) return tptS_quit(words); break; case TypeNumber: - return NumberType(atoi(rawWord)); + return NumberType(parseNumber(rawWord)); case TypePoint: { int pointX, pointY; diff --git a/src/cat/TPTScriptInterface.h b/src/cat/TPTScriptInterface.h index 3cb0b5fe6..dea284e73 100644 --- a/src/cat/TPTScriptInterface.h +++ b/src/cat/TPTScriptInterface.h @@ -7,6 +7,7 @@ class TPTScriptInterface: public CommandInterface { protected: AnyType eval(std::deque * words); + int parseNumber(char * stringData); AnyType tptS_set(std::deque * words); AnyType tptS_create(std::deque * words); AnyType tptS_delete(std::deque * words); From 533a15ec9d7535de55eefcec9e44e53fa3a9a226 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Tue, 26 Mar 2013 09:31:46 +0000 Subject: [PATCH 5/6] Update version number --- src/Config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Config.h b/src/Config.h index 0cb3b0e07..a3979029a 100644 --- a/src/Config.h +++ b/src/Config.h @@ -16,11 +16,11 @@ #endif #ifndef MINOR_VERSION -#define MINOR_VERSION 1 +#define MINOR_VERSION 2 #endif #ifndef BUILD_NUM -#define BUILD_NUM 262 +#define BUILD_NUM 263 #endif #ifndef SNAPSHOT_ID From f7dd658a301bf22802b72f0d338c6a769e28ed0a Mon Sep 17 00:00:00 2001 From: cracker64 Date: Wed, 27 Mar 2013 12:34:03 -0300 Subject: [PATCH 6/6] SPRK from SWCH should check both cases. --- src/simulation/elements/SPRK.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/simulation/elements/SPRK.cpp b/src/simulation/elements/SPRK.cpp index 81223851a..d44145540 100644 --- a/src/simulation/elements/SPRK.cpp +++ b/src/simulation/elements/SPRK.cpp @@ -254,7 +254,7 @@ int Element_SPRK::update(UPDATE_FUNC_ARGS) case PT_SWCH: if (receiver==PT_PSCN||receiver==PT_NSCN||receiver==PT_WATR||receiver==PT_SLTW||receiver==PT_NTCT||receiver==PT_PTCT||receiver==PT_INWR) continue; - goto conduct; + break; case PT_ETRD: if (receiver==PT_METL||receiver==PT_BMTL||receiver==PT_BRMT||receiver==PT_LRBD||receiver==PT_RBDM||receiver==PT_PSCN||receiver==PT_NSCN) goto conduct;