add back bounds check to DTEC/TSNS where needed, change VIBR back to 5x5 loop checks

a better way to change it to 3x3 may have to be found that has the same ratios, other elements like WATRs have their rates changed too
This commit is contained in:
jacob1 2013-03-17 12:21:45 -04:00
parent b617b8b656
commit d357fcdc36
3 changed files with 5 additions and 5 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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);
}