summaryrefslogtreecommitdiff
path: root/src/simulation/elements
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2013-03-21 21:49:59 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2013-03-21 21:49:59 (GMT)
commitc4a500aa21c0255e0bd919ae2f16b048226a3dd7 (patch)
tree5473d375d112cf721c7c9b3d4cd88438ff853a41 /src/simulation/elements
parent81a34222d1797f112a65c30f9ef7db07562ffdf1 (diff)
parentd357fcdc36e931d2f561fc8e684618d572a35e6d (diff)
downloadpowder-c4a500aa21c0255e0bd919ae2f16b048226a3dd7.zip
powder-c4a500aa21c0255e0bd919ae2f16b048226a3dd7.tar.gz
Merge
Diffstat (limited to 'src/simulation/elements')
-rw-r--r--src/simulation/elements/DTEC.cpp2
-rw-r--r--src/simulation/elements/TSNS.cpp2
-rw-r--r--src/simulation/elements/VIBR.cpp6
3 files changed, 5 insertions, 5 deletions
diff --git a/src/simulation/elements/DTEC.cpp b/src/simulation/elements/DTEC.cpp
index 69218e6..71bbf8b 100644
--- a/src/simulation/elements/DTEC.cpp
+++ b/src/simulation/elements/DTEC.cpp
@@ -75,7 +75,7 @@ int Element_DTEC::update(UPDATE_FUNC_ARGS)
}
for (rx=-rd; rx<rd+1; rx++)
for (ry=-rd; ry<rd+1; ry++)
- if (BOUNDS_CHECK && (rx || ry))
+ if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if(!r)
diff --git a/src/simulation/elements/TSNS.cpp b/src/simulation/elements/TSNS.cpp
index 6e6461f..d82194c 100644
--- a/src/simulation/elements/TSNS.cpp
+++ b/src/simulation/elements/TSNS.cpp
@@ -75,7 +75,7 @@ int Element_TSNS::update(UPDATE_FUNC_ARGS)
}
for (rx=-rd; rx<rd+1; rx++)
for (ry=-rd; ry<rd+1; ry++)
- if (BOUNDS_CHECK && (rx || ry))
+ if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if(!r)
diff --git a/src/simulation/elements/VIBR.cpp b/src/simulation/elements/VIBR.cpp
index b6c7df6..ee57565 100644
--- a/src/simulation/elements/VIBR.cpp
+++ b/src/simulation/elements/VIBR.cpp
@@ -131,8 +131,8 @@ int Element_VIBR::update(UPDATE_FUNC_ARGS) {
}
}
//Neighbor check loop
- for (rx=-1; rx<2; rx++)
- for (ry=-1; ry<2; ry++)
+ for (rx=-2; rx<3; rx++)
+ for (ry=-2; ry<3; ry++)
if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
@@ -141,7 +141,7 @@ int Element_VIBR::update(UPDATE_FUNC_ARGS) {
if (!r)
continue;
//Melts into EXOT
- if ((r&0xFF) == PT_EXOT && !(rand()%83) && !parts[i].life)
+ if ((r&0xFF) == PT_EXOT && !(rand()%250) && !parts[i].life)
{
sim->create_part(i, x, y, PT_EXOT);
}