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:
parent
b617b8b656
commit
d357fcdc36
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user