+ if (0 < map_object->lifepoints) /* map_object is animate. */
+ {
+ if (0 == first_round && 0 == map_object->progress)
+ {
+ if (map_object == player)
+ {
+ break;
+ }
+ char * sel = "NSEW";
+ map_object->command = get_moa_id_by_name("move");
+ map_object->arg = sel[rrand() % 4];
+ }
+ first_round = 0;
+ map_object->progress++;
+ struct MapObjAct * moa = world.map_obj_acts;
+ while (moa->id != map_object->command)
+ {
+ moa = moa->next;
+ }
+ if (map_object->progress == moa->effort)
+ {
+ moa->func(map_object);
+ map_object->progress = 0;
+ }
+ }
+ map_object = map_object->next;