- struct MapObjDef * mod = get_map_obj_def(world, monster->map_obj.type);
- char * hit_dsc = "You hit the ";
- char * monster_dsc = mod->desc;
- char * msg = malloc(strlen(hit_dsc) + strlen(monster_dsc) + 3);
- sprintf(msg, "\n%s%s.", hit_dsc, monster_dsc);
- update_log(world, msg);
- free(msg);
- monster->hitpoints--;
-
- if (0 == monster->hitpoints)
- {
- hit_dsc = "You kill the ";
- msg = malloc(strlen(hit_dsc) + strlen(monster_dsc) + 3);
- sprintf(msg, "\n%s%s.", hit_dsc, monster_dsc);
- update_log(world, msg);
- free(msg);
- if (world->monster == monster)
+ struct yx_uint16 target = mv_yx_in_dir(d, actor->pos);
+ struct MapObj * other_actor;
+ for (other_actor = world.map_objs;
+ other_actor != 0;
+ other_actor = other_actor->next)
+ {
+ if (0 == other_actor->lifepoints || other_actor == actor)