diff options
| author | jacksonmj <jacksonmj@jacksonmj.none> | 2011-01-09 20:21:03 (GMT) |
|---|---|---|
| committer | jacksonmj <jacksonmj@jacksonmj.none> | 2011-01-09 20:42:52 (GMT) |
| commit | 6094753eb18fd315acd0eaecaaf19ecf609acfbe (patch) | |
| tree | 32af87d2b60344688bbc2816071c2a308c4fd8f2 /src | |
| parent | 134d8a68740b9def376d2684825400d98751ccba (diff) | |
| download | powder-6094753eb18fd315acd0eaecaaf19ecf609acfbe.zip powder-6094753eb18fd315acd0eaecaaf19ecf609acfbe.tar.gz | |
Fix photon reflection (second attempt).
Previous attempt broke photons in glass.
Diffstat (limited to 'src')
| -rw-r--r-- | src/powder.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/powder.c b/src/powder.c index 60dbe1e..bcdd924 100644 --- a/src/powder.c +++ b/src/powder.c @@ -260,14 +260,14 @@ int try_move(int i, int x, int y, int nx, int ny) static unsigned direction_to_map(float dx, float dy) { - return (dx >= -0.1) | - (((dx + dy) >= -0.1) << 1) | /* 567 */ - ((dy >= -0.1) << 2) | /* 4+0 */ - (((dy - dx) >= -0.1) << 3) | /* 321 */ - ((dx <= 0.1) << 4) | - (((dx + dy) <= 0.1) << 5) | - ((dy <= 0.1) << 6) | - (((dy - dx) <= 0.1) << 7); + return (dx >= -0.01) | + (((dx + dy) >= -0.01) << 1) | /* 567 */ + ((dy >= -0.01) << 2) | /* 4+0 */ + (((dy - dx) >= -0.01) << 3) | /* 321 */ + ((dx <= 0.01) << 4) | + (((dx + dy) <= 0.01) << 5) | + ((dy <= 0.01) << 6) | + (((dy - dx) <= 0.01) << 7); } static int is_blocking(int t, int x, int y) |
