-/* NetHack 3.6 sp_lev.c $NHDT-Date: 1580610435 2020/02/02 02:27:15 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.153 $ */
+/* NetHack 3.6 sp_lev.c $NHDT-Date: 1581373396 2020/02/10 22:23:16 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.155 $ */
/* Copyright (c) 1989 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */
selection_free(sel)
struct selectionvar *sel;
{
- if (!sel)
- return;
- Free(sel->map);
- sel->map = NULL;
- sel->wid = sel->hei = 0;
+ if (sel) {
+ Free(sel->map);
+ sel->map = NULL;
+ sel->wid = sel->hei = 0;
+ free((genericptr_t) sel);
+ }
}
struct selectionvar *
selection_setpoint(x, y, ov, 1);
selection_free(tmp);
- free(tmp);
}
static int FDECL((*selection_flood_check_func), (int, int));
#undef SEL_FLOOD_STACK
#undef SEL_FLOOD_CHKDIR
selection_free(tmp);
- free(tmp);
}
/* McIlroy's Ellipse Algorithm */
res = FALSE;
gotitdone:
selection_free(ov2);
- free(ov2);
selection_free(ov3);
- free(ov3);
return res;
}
do {
ret = TRUE;
- for (x = 0; x < COLNO; x++)
+ for (x = 1; x < COLNO; x++)
for (y = 0; y < ROWNO; y++)
if (ACCESSIBLE(levl[x][y].typ)
&& !selection_getpoint(x, y, ov)) {
- if (generate_way_out_method(x,y, ov))
- selection_floodfill(ov, x,y, TRUE);
+ if (generate_way_out_method(x, y, ov))
+ selection_floodfill(ov, x, y, TRUE);
ret = FALSE;
goto outhere;
}
- outhere: ;
+ outhere:
+ ;
} while (!ret);
selection_free(ov);
- free(ov);
}
int
if (sel) {
selection_iterate(sel, sel_set_wall_property, (genericptr_t) &prop);
- if (freesel) {
+ if (freesel)
selection_free(sel);
- free(sel);
- }
}
}