From 36adc3c516084f64657054b16d854ab3a368ff40 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Mon, 25 Mar 2013 01:18:47 -0300 Subject: Fix NEUT not going through INVS diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index d59ac51..03f90a1 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; -- cgit v0.9.2-21-gd62e From 9ef7a4c1a523e485c501d64644bfba9c1d7f3bb5 Mon Sep 17 00:00:00 2001 From: Saveliy Skresanov Date: Mon, 25 Mar 2013 20:09:55 +0700 Subject: Doxin's change to SConstruct for buildserv. diff --git a/SConstruct b/SConstruct index 1360e9f..81456fd 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) -- cgit v0.9.2-21-gd62e From 010f7790ebc72baf1fa3c99dfaeb8b69cdd3a0cb Mon Sep 17 00:00:00 2001 From: jacob1 Date: Mon, 25 Mar 2013 12:36:04 -0300 Subject: Fix CRAY bug that deletes particle 0 diff --git a/src/simulation/elements/CRAY.cpp b/src/simulation/elements/CRAY.cpp index 38c3b9f..3cba72a 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() {} -- cgit v0.9.2-21-gd62e From 0791f5b0f8c64252c3288d4612655370770dbc2c Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Tue, 26 Mar 2013 09:24:15 +0000 Subject: TPTScriptInterface: Ability to read hexadecimal constants diff --git a/src/cat/TPTScriptInterface.cpp b/src/cat/TPTScriptInterface.cpp index 84f55ef..a6a386f 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 3cb0b5f..dea284e 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); -- cgit v0.9.2-21-gd62e From 533a15ec9d7535de55eefcec9e44e53fa3a9a226 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Tue, 26 Mar 2013 09:31:46 +0000 Subject: Update version number diff --git a/src/Config.h b/src/Config.h index 0cb3b0e..a397902 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 -- cgit v0.9.2-21-gd62e From f7dd658a301bf22802b72f0d338c6a769e28ed0a Mon Sep 17 00:00:00 2001 From: cracker64 Date: Wed, 27 Mar 2013 12:34:03 -0300 Subject: SPRK from SWCH should check both cases. diff --git a/src/simulation/elements/SPRK.cpp b/src/simulation/elements/SPRK.cpp index 8122385..d441455 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; -- cgit v0.9.2-21-gd62e