Add CONV "keep properties" mode

This commit is contained in:
Ksawi 2023-01-15 21:25:45 +01:00 committed by GitHub
parent d02242714e
commit 325ffa1453
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,13 +81,16 @@ 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) == (parts[i].tmp2 == 1))))
if (!r || (restrictElement && ((TYP(r) == restrictElement) == (parts[i].tmp2 % 2))))
r = pmap[y+ry][x+rx];
if (!r || (restrictElement && ((TYP(r) == restrictElement) == (parts[i].tmp2 == 1))))
if (!r || (restrictElement && ((TYP(r) == restrictElement) == (parts[i].tmp2 % 2))))
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));
if(parts[i].tmp2 < 2)
sim->create_part(ID(r), x+rx, y+ry, TYP(parts[i].ctype), ID(parts[i].ctype));
else
sim->part_change_type(ID(r), x+rx, y+ry, TYP(parts[i].ctype));
}
}
}