… | |
… | |
1068 | { |
1068 | { |
1069 | shopinv *s1 = (shopinv *) a1, *s2 = (shopinv *) a2; |
1069 | shopinv *s1 = (shopinv *) a1, *s2 = (shopinv *) a2; |
1070 | |
1070 | |
1071 | if (s1->type < s2->type) |
1071 | if (s1->type < s2->type) |
1072 | return -1; |
1072 | return -1; |
|
|
1073 | |
1073 | if (s1->type > s2->type) |
1074 | if (s1->type > s2->type) |
1074 | return 1; |
1075 | return 1; |
1075 | |
1076 | |
1076 | /* the type is the same (what atoi gets), so do a strcasecmp to sort |
1077 | /* the type is the same (what atoi gets), so do a strcasecmp to sort |
1077 | * via alphabetical order |
1078 | * via alphabetical order |
… | |
… | |
1210 | |
1211 | |
1211 | /* elmex: this function checks whether the object is in a shop */ |
1212 | /* elmex: this function checks whether the object is in a shop */ |
1212 | bool |
1213 | bool |
1213 | is_in_shop (object *o) |
1214 | is_in_shop (object *o) |
1214 | { |
1215 | { |
1215 | if (!o->map) |
1216 | if (!o->is_on_map ()) |
1216 | return false; |
1217 | return false; |
1217 | |
1218 | |
1218 | return is_in_shop (o->map, o->x, o->y); |
1219 | return is_in_shop (o->map, o->x, o->y); |
1219 | } |
1220 | } |
1220 | |
1221 | |
… | |
… | |
1228 | is_in_shop (maptile *map, int x, int y) |
1229 | is_in_shop (maptile *map, int x, int y) |
1229 | { |
1230 | { |
1230 | for (object *floor = GET_MAP_OB (map, x, y); floor; floor = floor->above) |
1231 | for (object *floor = GET_MAP_OB (map, x, y); floor; floor = floor->above) |
1231 | if (QUERY_FLAG (floor, FLAG_IS_FLOOR)) |
1232 | if (QUERY_FLAG (floor, FLAG_IS_FLOOR)) |
1232 | return floor->type == SHOP_FLOOR; |
1233 | return floor->type == SHOP_FLOOR; |
|
|
1234 | |
1233 | return false; |
1235 | return false; |
1234 | } |
1236 | } |
1235 | |
1237 | |