+ if (0 != owns_none)
+ {
+ update_log("\nYou try to drop an object, but you own none.");
+ }
+ else
+ {
+ update_log("\nYou drop an object.");
+ if (0 < world.inventory_select)
+ {
+ world.inventory_select--;
+ }
+ }
+}
+
+
+
+static void playerbonus_pick(uint8_t picked)
+{
+ if (picked)
+ {
+ update_log("\nYou pick up an object.");
+ }
+ else
+ {
+ update_log("\nYou try to pick up an object, but there is none.");
+ }
+}
+
+
+
+static void playerbonus_use(uint8_t no_object, uint8_t wrong_object)
+{
+ if (no_object)
+ {
+ update_log("\nYou try to use an object, but you own none.");
+ }
+ else if (wrong_object)
+ {
+ update_log("\nYou try to use this object, but fail.");
+ }
+ else
+ {
+ update_log("\nYou consume MAGIC MEAT.");
+ if (0 < world.inventory_select)
+ {
+ world.inventory_select--;
+ }
+ }
+}
+
+
+
+extern void init_map_object_actions()
+{
+ char * f_name = "init_map_object_actions()";
+
+ char * path = "config/map_object_actions";
+ FILE * file = try_fopen(path, "r", f_name);
+ uint16_t linemax = get_linemax(file, f_name);
+ char line[linemax + 1];
+
+ struct MapObjAct ** moa_ptr_ptr = &world.map_obj_acts;
+ char * delim = " ";
+ while (fgets(line, linemax + 1, file))
+ {
+ if ('\n' == line[0] || 0 == line[0])
+ {
+ break;
+ }
+ struct MapObjAct * moa = try_malloc(sizeof(struct MapObjAct), f_name);
+ moa->id = atoi(strtok(line, delim));
+ moa->effort = atoi(strtok(NULL, delim));
+ char * funcname = strtok(NULL, "\n");
+ uint8_t len_name = strlen(funcname) + 1;
+ moa->name = try_malloc(len_name, f_name);
+ memcpy(moa->name, funcname, len_name);
+ if (!( try_func_name(moa, "move", actor_move)
+ || try_func_name(moa, "pick_up", actor_pick)
+ || try_func_name(moa, "drop", actor_drop)
+ || try_func_name(moa, "use", actor_use)))
+ {
+ moa->func = actor_wait;
+ }
+ moa->next = NULL;
+ * moa_ptr_ptr = moa;
+ moa_ptr_ptr = &moa->next;
+ }
+ try_fclose(file, f_name);
+}
+
+
+
+extern void free_map_object_actions(struct MapObjAct * moa)
+{
+ if (NULL == moa)