home · contact · privacy
Not very elegant solution to bug of appropriate inventory selection not being saved...
[plomrogue] / src / misc.c
index aa855cd19c39fbe9416fa5986fe37036da4e5c7b..bddf571288bc6860ef143d679042687d9545dd1a 100644 (file)
@@ -22,6 +22,8 @@
                          * sorted_wintoggle_and_activate()
                          */
 #include "windows.h" /* for suspend_win() */
+#include "command_db.h" /* for is_command_id_shortdsc() */
+
 
 
 extern char * trouble_msg(struct World * w, char * parent, char * child)
@@ -212,6 +214,11 @@ extern void turn_over(struct World * world, char action)
         }
         try_fclose(file_old, world, f_name);
         exit_err(write_uint8(action, file_new), world, err_write);
+        if (is_command_id_shortdsc(world, action, "drop"))
+        {
+            uint8_t inventory_select = world->old_inventory_select;
+            exit_err(write_uint8(inventory_select, file_new), world, err_write);
+        }
         try_fclose_unlink_rename(file_new, recordfile_tmp, recordfile,
                                  world, f_name);
     }