… | |
… | |
1075 | void |
1075 | void |
1076 | mapspace::update_ () |
1076 | mapspace::update_ () |
1077 | { |
1077 | { |
1078 | object *tmp, *last = 0; |
1078 | object *tmp, *last = 0; |
1079 | uint8 flags = P_UPTODATE, light = 0, anywhere = 0; |
1079 | uint8 flags = P_UPTODATE, light = 0, anywhere = 0; |
1080 | facetile *top, *floor, *middle; |
1080 | faceidx top, floor, middle; |
1081 | object *top_obj, *floor_obj, *middle_obj; |
1081 | object *top_obj, *floor_obj, *middle_obj; |
1082 | MoveType move_block = 0, move_slow = 0, move_on = 0, move_off = 0, move_allow = 0; |
1082 | MoveType move_block = 0, move_slow = 0, move_on = 0, move_off = 0, move_allow = 0; |
1083 | |
1083 | |
1084 | middle = blank_face; |
1084 | middle = blank_face; |
1085 | top = blank_face; |
1085 | top = blank_face; |
… | |
… | |
1134 | } |
1134 | } |
1135 | /* Find the highest visible face around. If equal |
1135 | /* Find the highest visible face around. If equal |
1136 | * visibilities, we still want the one nearer to the |
1136 | * visibilities, we still want the one nearer to the |
1137 | * top |
1137 | * top |
1138 | */ |
1138 | */ |
1139 | else if (middle == blank_face || (tmp->face->visibility > middle->visibility && !anywhere)) |
1139 | else if (middle == blank_face || (::faces [tmp->face].visibility > ::faces [middle].visibility && !anywhere)) |
1140 | { |
1140 | { |
1141 | middle = tmp->face; |
1141 | middle = tmp->face; |
1142 | middle_obj = tmp; |
1142 | middle_obj = tmp; |
1143 | } |
1143 | } |
1144 | } |
1144 | } |
… | |
… | |
1687 | for (int i = 1000; --i;) |
1687 | for (int i = 1000; --i;) |
1688 | { |
1688 | { |
1689 | object *pick = at (rndm (width), rndm (height)).bot; |
1689 | object *pick = at (rndm (width), rndm (height)).bot; |
1690 | |
1690 | |
1691 | // do not prefer big monsters just because they are big. |
1691 | // do not prefer big monsters just because they are big. |
1692 | if (pick->head_ () == pick) |
1692 | if (pick && pick->head_ () == pick) |
1693 | return pick->head_ (); |
1693 | return pick->head_ (); |
1694 | } |
1694 | } |
1695 | |
1695 | |
1696 | // instead of crashing in the unlikely(?) case, try to return *something* |
1696 | // instead of crashing in the unlikely(?) case, try to return *something* |
1697 | return get_archetype ("blocked"); |
1697 | return get_archetype ("blocked"); |