X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain.c;h=86f8507869cd3e28899b67dde5ed97ed59a9b348;hb=470540c932775c26a65513935bbc1c17dc19468d;hp=b27cf5d5724bfd446b484e90ba045d95ca019b43;hpb=d701e79e9297470b56315eefd431c62c9aba28b2;p=plomrogue diff --git a/src/main.c b/src/main.c index b27cf5d..86f8507 100644 --- a/src/main.c +++ b/src/main.c @@ -29,6 +29,7 @@ #include "control.h" /* for control_by_id(), player_control(), * get_available_keycode_to_action() */ +#include "map_object_actions.h" /* for init_map_object_actions() */ @@ -37,8 +38,11 @@ int main(int argc, char *argv[]) char * f_name = "main()"; world.turn = 0; /* Turns to 1 when map and objects are initalized. */ + /* Initialize commands and map object actions. */ init_command_db(); set_cleanup_flag(CLEANUP_COMMAND_DB); + init_map_object_actions(); + set_cleanup_flag(CLEANUP_MAPOBJACTS); /* Check for corrupted savefile / recordfile savings. */ char * recordfile = "record"; @@ -180,7 +184,8 @@ int main(int argc, char *argv[]) { break; } - if (is_command_id_shortdsc(action, "drop")) + if ( is_command_id_shortdsc(action, "drop") + || is_command_id_shortdsc(action, "use")) { world.inventory_select = getc(file); } @@ -203,7 +208,8 @@ int main(int argc, char *argv[]) action = getc(file); if (EOF != action) { - if (is_command_id_shortdsc(action, "drop")) + if ( is_command_id_shortdsc(action, "drop") + || is_command_id_shortdsc(action, "use")) { world.inventory_select = getc(file); }