Thread: Angband 4.2.0
View Single Post
Old August 29, 2019, 16:04   #99
PowerWyrm's Avatar
Join Date: Apr 2008
Posts: 2,796
PowerWyrm is on a distinguished road
Another bug in effect_handler_EARTHQUAKE() spotted while porting the struct loc refactoring (commit 7be84e3):

old code:

y = py + ddy_ddd[i];
x = px + ddx_ddd[i];
if (map[16 + y - centre.y][16 + x - centre.x]) continue;
new code:

struct loc grid = loc_sum(pgrid, ddgrid_ddd[i]);
if (map[16 + y - centre.y][16 + x - centre.x]) continue;
This leaves x and y uninitialized (in fact they should be equal to 32), breaking earthquakes.

Fix: replace with grid.y and grid.x.
PWMAngband variant maintainer - check (or to learn more about this new variant!
PowerWyrm is offline   Reply With Quote