summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/powder.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/powder.c b/src/powder.c
index 63dcee0..af819bd 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -1883,6 +1883,13 @@ killed:
fin_x = (int)(parts[i].x + parts[i].vx + 0.5f);
fin_y = (int)(parts[i].y + parts[i].vy + 0.5f);
// cast as int then back to float for compatibility with existing saves
+ if (t==PT_PHOT) {
+ s = eval_move(PT_PHOT, fin_x, fin_y, &r);
+ if ((((r&0xFF)==PT_GLAS && lt!=PT_GLAS) || ((r&0xFF)!=PT_GLAS && lt==PT_GLAS)) && s) {
+ // if movement will involve refraction, leave it until next frame so that refraction happens correctly
+ goto movedone;
+ }
+ }
if (try_move(i, x, y, fin_x, fin_y)) {
parts[i].x = (float)fin_x;
parts[i].y = (float)fin_y;