Make PHOT change its wavelength upon colliding with charged LITH (#841)
Co-authored-by: Tamás Bálint Misius <lbphacker@gmail.com>
This commit is contained in:
parent
f70f222a61
commit
23af1042b4
@ -4351,8 +4351,18 @@ killed:
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TYP(r))
|
if (t == PT_PHOT)
|
||||||
parts[i].ctype &= elements[TYP(r)].PhotonReflectWavelengths;
|
{
|
||||||
|
auto mask = elements[TYP(r)].PhotonReflectWavelengths;
|
||||||
|
if (TYP(r) == PT_LITH)
|
||||||
|
{
|
||||||
|
int wl_bin = parts[ID(r)].ctype / 4;
|
||||||
|
if (wl_bin < 0) wl_bin = 0;
|
||||||
|
if (wl_bin > 25) wl_bin = 25;
|
||||||
|
mask = (0x1F << wl_bin);
|
||||||
|
}
|
||||||
|
parts[i].ctype &= mask;
|
||||||
|
}
|
||||||
|
|
||||||
if (get_normal_interp(t, parts[i].x, parts[i].y, parts[i].vx, parts[i].vy, &nrx, &nry))
|
if (get_normal_interp(t, parts[i].x, parts[i].y, parts[i].vx, parts[i].vy, &nrx, &nry))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user