#include "../common/rexit.h" /* exit_err() */
#include "../common/try_malloc.h" /* try_malloc() */
#include "../common/yx_uint8.h" /* struct yx_uint8 */
+#include "field_of_view.h" /* build_fov_map() */
#include "map_objects.h" /* structs MapObj, MapObjDef, get_player(),
* set_object_position(), own_map_object(),
* get_map_object_def()
static void playerbonus_move(char d, uint8_t passable)
{
- char * dsc_dir = "north";
- if ( match_dir(d, &dsc_dir, '6', "east")
- || match_dir(d, &dsc_dir, '2', "south")
- || match_dir(d, &dsc_dir, '4', "west")
- || match_dir(d, &dsc_dir, '7', "north-west")
- || match_dir(d, &dsc_dir, '9', "north-east")
- || match_dir(d, &dsc_dir, '1', "south-west")
- || match_dir(d, &dsc_dir, '3', "south-east"))
+ char * dsc_dir = "north-east";
+ if ( match_dir(d, &dsc_dir, 'd', "east")
+ || match_dir(d, &dsc_dir, 'c', "south-east")
+ || match_dir(d, &dsc_dir, 'x', "south-west")
+ || match_dir(d, &dsc_dir, 's', "west")
+ || match_dir(d, &dsc_dir, 'w', "north-west"))
{
;
}
if (passable)
{
set_object_position(mo, target);
+ free(mo->fov_map);
+ mo->fov_map = build_fov_map(mo);
}
if (mo == get_player())
{