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

old code:

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

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 http://powerwyrm.monsite-orange.fr (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
PowerWyrm is offline   Reply With Quote