summaryrefslogtreecommitdiff
path: root/src/simulation/Simulation.cpp
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-06-10 14:51:55 (GMT)
committer jacob1 <jfu614@gmail.com>2013-06-10 14:51:55 (GMT)
commitb699bb176f41012a43c42dbbf1ec82b7e1c27d3d (patch)
tree3aa231af016fd8cd654b5aaec72ec12eecdc8a17 /src/simulation/Simulation.cpp
parent52ec8f438b6ce3373c9258cbde402b4caef92b1e (diff)
downloadpowder-b699bb176f41012a43c42dbbf1ec82b7e1c27d3d.zip
powder-b699bb176f41012a43c42dbbf1ec82b7e1c27d3d.tar.gz
Add two new properties for CLNE-like elements
the thing CLNE does, drawing upon it will set ctype; and what BCLN does to CLNE - disables #1). Made use of the two new properties
Diffstat (limited to 'src/simulation/Simulation.cpp')
-rw-r--r--src/simulation/Simulation.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp
index c420f3b..e696581 100644
--- a/src/simulation/Simulation.cpp
+++ b/src/simulation/Simulation.cpp
@@ -2033,6 +2033,7 @@ void Simulation::init_can_move()
}
}
//a list of lots of things PHOT can move through
+ // TODO: replace with property
for (movingType = 0; movingType < PT_NUM; movingType++)
{
if (movingType == PT_GLAS || movingType == PT_PHOT || movingType == PT_FILT || movingType == PT_INVIS
@@ -2721,20 +2722,17 @@ int Simulation::create_part(int p, int x, int y, int tv)
{
if (pmap[y][x])
{
+ //If an element has the PROP_DRAWONCTYPE property, and the element being drawn to it does not have PROP_NOCTYPEDRAW (Also some special cases), set the element's ctype
int drawOn = pmap[y][x]&0xFF;
- if ((
- (drawOn == PT_STOR && !(elements[t].Properties&TYPE_SOLID)) ||
- drawOn==PT_CLNE ||
- drawOn==PT_BCLN ||
- drawOn==PT_CONV ||
- (drawOn==PT_PCLN&&t!=PT_PSCN&&t!=PT_NSCN) ||
- (drawOn==PT_PBCN&&t!=PT_PSCN&&t!=PT_NSCN)
- )&&(
- t != PT_CLNE && t != PT_PCLN && t != PT_BCLN && t != PT_STKM && t != PT_STKM2 && t != PT_PBCN && t != PT_STOR && t != PT_FIGH && t != PT_CONV)
- )
+ if (((elements[drawOn].Properties & PROP_DRAWONCTYPE) ||
+ (drawOn == PT_STOR && !(elements[t].Properties & TYPE_SOLID)) ||
+ (drawOn == PT_PCLN && t != PT_PSCN && t != PT_NSCN) ||
+ (drawOn == PT_PBCN && t != PT_PSCN && t != PT_NSCN))
+ && (!(elements[t].Properties & PROP_NOCTYPEDRAW)))
{
parts[pmap[y][x]>>8].ctype = t;
- if (t == PT_LIFE && v < NGOL && drawOn != PT_STOR) parts[pmap[y][x]>>8].tmp = v;
+ if (t == PT_LIFE && v < NGOL && drawOn != PT_STOR)
+ parts[pmap[y][x]>>8].tmp = v;
}
else if ((drawOn == PT_DTEC || (drawOn == PT_PSTN && t != PT_FRME)) && drawOn != t)
{