summaryrefslogtreecommitdiff
path: root/src/simulation/elements/VIBR.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2013-03-14 11:30:35 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2013-03-14 11:30:35 (GMT)
commit9ab70756af4fb3f0f9c4e287f1b30e0897a19741 (patch)
treebcdeaecbe71f0152e9a9c9b81ee65e4aa1f717ec /src/simulation/elements/VIBR.cpp
parent9479b7f3300658156c467980c28d3436a728bc0c (diff)
parent10e104f3f51ed7de80419e2eba0fbbad457aa528 (diff)
downloadpowder-9ab70756af4fb3f0f9c4e287f1b30e0897a19741.zip
powder-9ab70756af4fb3f0f9c4e287f1b30e0897a19741.tar.gz
Merge branch 'master' of github.com:FacialTurd/The-Powder-Toy
Diffstat (limited to 'src/simulation/elements/VIBR.cpp')
-rw-r--r--src/simulation/elements/VIBR.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/simulation/elements/VIBR.cpp b/src/simulation/elements/VIBR.cpp
index a5ad8b1..ee57565 100644
--- a/src/simulation/elements/VIBR.cpp
+++ b/src/simulation/elements/VIBR.cpp
@@ -99,7 +99,7 @@ int Element_VIBR::update(UPDATE_FUNC_ARGS) {
int random = rand();
rx = random%7-3;
ry = (random>>3)%7-3;
- if(x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES)
+ if(BOUNDS_CHECK)
{
r = pmap[y+ry][x+rx];
if ((r&0xFF) && (r&0xFF)!=PT_VIBR && (r&0xFF)!=PT_BVBR && sim->elements[r&0xFF].HeatConduct && ((r&0xFF)!=PT_HSWC||parts[r>>8].life==10))
@@ -133,7 +133,7 @@ int Element_VIBR::update(UPDATE_FUNC_ARGS) {
//Neighbor check loop
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
@@ -166,7 +166,7 @@ int Element_VIBR::update(UPDATE_FUNC_ARGS) {
int random = rand();
rx = random%7-3;
ry = (random>>3)%7-3;
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
if ((r&0xFF) != PT_VIBR && (r&0xFF) != PT_BVBR)