Skip to content

Commit

Permalink
MIX won't mix together elements with different states now
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob1 committed Jul 19, 2016
1 parent b65e949 commit 95fde9d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/simulation/Elements.h
Expand Up @@ -15,6 +15,7 @@
#define TYPE_SOLID 0x00004 //4 Solids
#define TYPE_GAS 0x00008 //8 Gasses (Includes plasma)
#define TYPE_ENERGY 0x00010 //16 Energy (Thunder, Light, Neutrons etc.)
#define STATE_FLAGS 0x0001F
#define PROP_CONDUCTS 0x00020 //32 Conducts electricity
#define PROP_BLACK 0x00040 //64 Absorbs Photons (not currently implemented or used, a photwl attribute might be better)
#define PROP_NEUTPENETRATE 0x00080 //128 Penetrated by neutrons
Expand Down
2 changes: 1 addition & 1 deletion src/simulation/simtools/Mix.cpp
Expand Up @@ -32,7 +32,7 @@ int Tool_Mix::Perform(Simulation * sim, Particle * cpart, int x, int y, float st
if(!thatPart)
return 0;

if(!(sim->elements[thatPart&0xFF].Properties & (TYPE_PART | TYPE_LIQUID | TYPE_GAS)))
if ((sim->elements[thisPart&0xFF].Properties&STATE_FLAGS) != (sim->elements[thatPart&0xFF].Properties&STATE_FLAGS))
return 0;

sim->pmap[y][x] = thatPart;
Expand Down

0 comments on commit 95fde9d

Please sign in to comment.