summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-08-30 02:34:50 (GMT)
committer jacob1 <jfu614@gmail.com>2013-08-30 02:34:50 (GMT)
commit2cbee180a1e8e8fd08d9ecca82c86d8f689d1fc6 (patch)
tree9e244506dcfbf9546341e059c06222a33213d697
parentd38af2764c682370b4f604d54142b984fdd079cf (diff)
downloadpowder-2cbee180a1e8e8fd08d9ecca82c86d8f689d1fc6.zip
powder-2cbee180a1e8e8fd08d9ecca82c86d8f689d1fc6.tar.gz
fix bug where PROP wouldn't set properties of particle id 0
-rw-r--r--src/simulation/Simulation.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp
index 6192356..f96fd3a 100644
--- a/src/simulation/Simulation.cpp
+++ b/src/simulation/Simulation.cpp
@@ -388,23 +388,23 @@ int Simulation::flood_prop_2(int x, int y, size_t propoffset, void * propvalue,
}
for (x=x1; x<=x2; x++)
{
- i = pmap[y][x]>>8;
+ i = pmap[y][x];
if (!i)
- i = photons[y][x]>>8;
+ i = photons[y][x];
if (!i)
continue;
switch (proptype) {
case StructProperty::Float:
- *((float*)(((char*)&parts[i])+propoffset)) = *((float*)propvalue);
+ *((float*)(((char*)&parts[i>>8])+propoffset)) = *((float*)propvalue);
break;
case StructProperty::ParticleType:
case StructProperty::Integer:
- *((int*)(((char*)&parts[i])+propoffset)) = *((int*)propvalue);
+ *((int*)(((char*)&parts[i>>8])+propoffset)) = *((int*)propvalue);
break;
case StructProperty::UInteger:
- *((unsigned int*)(((char*)&parts[i])+propoffset)) = *((unsigned int*)propvalue);
+ *((unsigned int*)(((char*)&parts[i>>8])+propoffset)) = *((unsigned int*)propvalue);
break;
default: