summaryrefslogtreecommitdiff
path: root/src/simulation/Simulation.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-08-05 15:59:14 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-08-05 15:59:14 (GMT)
commit30f8049efc6efc086509d235df413e4932dab83e (patch)
tree96642c3f8a63e15a40c448c23f5ada446eba673b /src/simulation/Simulation.cpp
parent9e309135d403f0f99f586015ffd194a8914ae504 (diff)
downloadpowder-30f8049efc6efc086509d235df413e4932dab83e.zip
powder-30f8049efc6efc086509d235df413e4932dab83e.tar.gz
Allow 24bits of var for create_part, add tool for tesc. Fixes #72
Diffstat (limited to 'src/simulation/Simulation.cpp')
-rw-r--r--src/simulation/Simulation.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp
index 6b78184..4fb9ac2 100644
--- a/src/simulation/Simulation.cpp
+++ b/src/simulation/Simulation.cpp
@@ -2443,12 +2443,14 @@ void Simulation::part_change_type(int i, int x, int y, int t)//changes the type
}
}
-int Simulation::create_part(int p, int x, int y, int tv)//the function for creating a particle, use p=-1 for creating a new particle, -2 is from a brush, or a particle number to replace a particle.
+//the function for creating a particle, use p=-1 for creating a new particle, -2 is from a brush, or a particle number to replace a particle.
+//tv = Type (8 bits) + Var (24 bits), var is usually 0
+int Simulation::create_part(int p, int x, int y, int tv)
{
int i;
int t = tv & 0xFF;
- int v = (tv >> 8) & 0xFF;
+ int v = (tv >> 8) & 0xFFFFFF;
if (x<0 || y<0 || x>=XRES || y>=YRES || ((t<=0 || t>=PT_NUM)&&t!=SPC_HEAT&&t!=SPC_COOL&&t!=SPC_AIR&&t!=SPC_VACUUM&&t!=SPC_PGRV&&t!=SPC_NGRV))
return -1;
@@ -2749,6 +2751,11 @@ int Simulation::create_part(int p, int x, int y, int tv)//the function for creat
case PT_EMBR:
parts[i].life = 50;
break;
+ case PT_TESC:
+ parts[i].tmp = v;
+ if (parts[i].tmp > 300)
+ parts[i].tmp=300;
+ break;
case PT_STKM:
if (player.spwn==0)
{