Update CONV.cpp

This commit is contained in:
Jakav-N 2022-11-19 14:41:54 -07:00
parent b393050e55
commit 63610f54d1

View File

@ -81,13 +81,13 @@ static int update(UPDATE_FUNC_ARGS)
if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES)
{
r = sim->photons[y+ry][x+rx];
if (!r || (restrictElement && TYP(r) != restrictElement))
r = pmap[y+ry][x+rx];
if (!r || (restrictElement && TYP(r) != restrictElement))
continue;
if (!r || (restrictElement && TYP(r) != restrictElement && parts[i].tmp2 != 1) || (restrictElement && TYP(r) == restrictElement && parts[i].tmp2 == 1))
r = pmap[y+ry][x+rx];
if (!r || (restrictElement && TYP(r) != restrictElement && parts[i].tmp2 != 1) || (restrictElement && TYP(r) == restrictElement && parts[i].tmp2 == 1))
continue;
if (TYP(r) != PT_CONV && TYP(r) != PT_DMND && TYP(r) != ctype)
{
sim->create_part(ID(r), x+rx, y+ry, TYP(parts[i].ctype), ID(parts[i].ctype));
sim->create_part(ID(r), x+rx, y+ry, TYP(parts[i].ctype), ID(parts[i].ctype));
}
}
}