summaryrefslogtreecommitdiff
path: root/src/simulation/elements/VIBR.cpp
diff options
context:
space:
mode:
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)