#include
int update_WOOD(UPDATE_FUNC_ARGS) {
int r, rx, ry, np;
for (rx=-2; rx<3; rx++)<br/> for (ry=-2; ry<3; ry++)<br/> if (x+rx>=0 && y+ry>0 && x+rx {
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_WATR && 1>(rand()%250))
{
np = create_part(r>>8,x+rx,y+ry,PT_PLNT);
if (np<0) continue;<br/> parts[np].life = 0;
}
}
return 0;
}
MassacreLand:
@vanquish349 (View Post)
E:\Unknown\L\Powder\Mod\MassacreToy\src\elements\wood.cIn function 'update_WOOD':
#include <element.h>
int update_WOOD(UPDATE_FUNC_ARGS) {
int r, rx, ry, np;
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))
{
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_WATR && 1>(rand()%250))
{
np = create_part(r>>8,x+rx,y+ry,PT_PLNT);
if (np<0) continue;
parts[np].life = 0;
}
}
return 0;
}