X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=src%2Fmain.c;h=74ef761ddbb1b440cc384a880641657046628b8c;hb=60a77cb1894c678fff62840dc6b24931d839f820;hp=a8f16d4d3799f2d0a2e4fe3583ad69e032899a30;hpb=d504e5724574f9502ec203d495284738601bb6a0;p=plomrogue diff --git a/src/main.c b/src/main.c index a8f16d4..74ef761 100644 --- a/src/main.c +++ b/src/main.c @@ -10,9 +10,9 @@ #include "windows.h" /* for structs WinMeta, Win, init_win_meta(), * draw_all_wins() */ -#include "readwrite.h" /* for read_uint32_bigendian(), +#include "readwrite.h" /* for try_fgetc(), read_uint32_bigendian(), * write_uint32_bigendian(), try_fopen(), try_fclose(), - * try_fclose_unlink_rename(), try_fgetc() + * try_fclose_unlink_rename(), try_fgetc_noeof(), */ #include "map_objects.h" /* for structs MapObj, init_map_object_defs(), * build_map_objects(), get_player() @@ -159,7 +159,7 @@ int main(int argc, char *argv[]) win_map->center = player->pos; /* Initialize player's inventory selection index to start position. */ - world.inventory_select = 0; + world.inventory_sel = 0; /* Replay mode. */ int key; @@ -171,7 +171,7 @@ int main(int argc, char *argv[]) { while (world.turn != start_turn) { - action = fgetc(file); + action = try_fgetc(file, f_name); if (EOF == action) { break; @@ -179,7 +179,7 @@ int main(int argc, char *argv[]) if ( is_command_id_shortdsc(action, "drop") || is_command_id_shortdsc(action, "use")) { - world.inventory_select = try_fgetc(file, f_name); + world.inventory_sel = try_fgetc_noeof(file, f_name); } player_control_by_id(action); } @@ -197,13 +197,13 @@ int main(int argc, char *argv[]) if ( EOF != action && key == get_available_keycode_to_action("wait")) { - action = fgetc(file); + action = try_fgetc(file, f_name); if (EOF != action) { if ( is_command_id_shortdsc(action, "drop") || is_command_id_shortdsc(action, "use")) { - world.inventory_select = try_fgetc(file, f_name); + world.inventory_sel = try_fgetc_noeof(file, f_name); } player_control_by_id(action); }