- mod = get_map_obj_def(world, monster->map_obj.type);
- desc_other = mod->desc;
- sprintf(msg, "\n%s bumps into %s.", desc, desc_other);
- update_log(world, msg);
- return;
+ 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;