… | |
… | |
1268 | return false; |
1268 | return false; |
1269 | |
1269 | |
1270 | return is_in_shop (o->map, o->x, o->y); |
1270 | return is_in_shop (o->map, o->x, o->y); |
1271 | } |
1271 | } |
1272 | |
1272 | |
1273 | /* elmex: this function checks whether we are in a shop or not */ |
1273 | /* elmex: this function checks whether we are in a shop or not |
|
|
1274 | - change 2007-11-26: enhanced the O(n) case by stopping at the first |
|
|
1275 | floor tile. this possibly will make map bugs where shopfloors are above |
|
|
1276 | floors more obvious. |
|
|
1277 | */ |
|
|
1278 | |
1274 | bool |
1279 | bool |
1275 | is_in_shop (maptile *map, int x, int y) |
1280 | is_in_shop (maptile *map, int x, int y) |
1276 | { |
1281 | { |
1277 | for (object *floor = GET_MAP_OB (map, x, y); floor; floor = floor->above) |
1282 | for (object *floor = GET_MAP_OB (map, x, y); floor; floor = floor->above) |
|
|
1283 | if (QUERY_FLAG (floor, FLAG_IS_FLOOR)) |
1278 | if (floor->type == SHOP_FLOOR) |
1284 | return floor->type == SHOP_FLOOR; |
1279 | return true; |
|
|
1280 | |
|
|
1281 | return false; |
1285 | return false; |
1282 | } |
1286 | } |
1283 | |
1287 | |