change the type of xytod()'s return value to int

xytod()'s return value is an index, so its type should be int, not coordxy.
This commit is contained in:
SHIRAKATA Kentaro
2025-01-12 14:37:13 +09:00
parent 59f49fda1b
commit 9b7bcf67ba
4 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -414,7 +414,7 @@ extern int enter_explore_mode(void);
extern boolean bind_mousebtn(int, const char *); extern boolean bind_mousebtn(int, const char *);
extern boolean bind_key(uchar, const char *); extern boolean bind_key(uchar, const char *);
extern void dokeylist(void); extern void dokeylist(void);
extern coordxy xytod(coordxy, coordxy); extern int xytod(coordxy, coordxy);
extern void dtoxy(coord *, int); extern void dtoxy(coord *, int);
extern int movecmd(char, int); extern int movecmd(char, int);
extern int dxdy_moveok(void); extern int dxdy_moveok(void);
+1 -1
View File
@@ -3604,7 +3604,7 @@ rhack(int key)
} }
/* convert an x,y pair into a direction code */ /* convert an x,y pair into a direction code */
coordxy int
xytod(coordxy x, coordxy y) xytod(coordxy x, coordxy y)
{ {
int dd; int dd;
+2 -1
View File
@@ -6436,7 +6436,8 @@ conjoined_pits(
struct trap *trap1, struct trap *trap1,
boolean u_entering_trap2) boolean u_entering_trap2)
{ {
coordxy dx, dy, diridx, adjidx; coordxy dx, dy;
int diridx, adjidx;
if (!trap1 || !trap2) if (!trap1 || !trap2)
return FALSE; return FALSE;
+1 -1
View File
@@ -4126,7 +4126,7 @@ boomhit(struct obj *obj, coordxy dx, coordxy dy)
gb.bhitpos.x = u.ux; gb.bhitpos.x = u.ux;
gb.bhitpos.y = u.uy; gb.bhitpos.y = u.uy;
boom = counterclockwise ? S_boomleft : S_boomright; boom = counterclockwise ? S_boomleft : S_boomright;
i = (int) xytod(dx, dy); i = xytod(dx, dy);
tmp_at(DISP_FLASH, cmap_to_glyph(boom)); tmp_at(DISP_FLASH, cmap_to_glyph(boom));
for (ct = 0; ct < 10; ct++) { for (ct = 0; ct < 10; ct++) {
i = DIR_CLAMP(i); i = DIR_CLAMP(i);