… | |
… | |
502 | |
502 | |
503 | for (pouch = pl->inv; pouch && to_pay; pouch = pouch->below) |
503 | for (pouch = pl->inv; pouch && to_pay; pouch = pouch->below) |
504 | if (pouch->type == CONTAINER && QUERY_FLAG (pouch, FLAG_APPLIED) && (pouch->race == NULL || strstr (pouch->race, "gold"))) |
504 | if (pouch->type == CONTAINER && QUERY_FLAG (pouch, FLAG_APPLIED) && (pouch->race == NULL || strstr (pouch->race, "gold"))) |
505 | pay_from_container (pl, pouch, to_pay); |
505 | pay_from_container (pl, pouch, to_pay); |
506 | |
506 | |
507 | fix_player (pl); |
507 | pl->update_stats (); |
508 | return 1; |
508 | return 1; |
509 | } |
509 | } |
510 | |
510 | |
511 | /* DAMN: This is now a wrapper for pay_from_container, which is |
511 | /* DAMN: This is now a wrapper for pay_from_container, which is |
512 | * called for the player, then for each active container that can hold |
512 | * called for the player, then for each active container that can hold |
… | |
… | |
542 | pay_from_container (pl, pouch, to_pay); |
542 | pay_from_container (pl, pouch, to_pay); |
543 | |
543 | |
544 | if (settings.real_wiz == FALSE && QUERY_FLAG (pl, FLAG_WAS_WIZ)) |
544 | if (settings.real_wiz == FALSE && QUERY_FLAG (pl, FLAG_WAS_WIZ)) |
545 | SET_FLAG (op, FLAG_WAS_WIZ); |
545 | SET_FLAG (op, FLAG_WAS_WIZ); |
546 | |
546 | |
547 | fix_player (pl); |
547 | pl->update_stats (); |
548 | return 1; |
548 | return 1; |
549 | } |
549 | } |
550 | |
550 | |
551 | /* This pays for the item, and takes the proper amount of money off |
551 | /* This pays for the item, and takes the proper amount of money off |
552 | * the player. |
552 | * the player. |
… | |
… | |
1210 | magic_mapping_mark (op, map_mark, 3); |
1210 | magic_mapping_mark (op, map_mark, 3); |
1211 | items = (shopinv *) malloc (40 * sizeof (shopinv)); |
1211 | items = (shopinv *) malloc (40 * sizeof (shopinv)); |
1212 | numallocated = 40; |
1212 | numallocated = 40; |
1213 | |
1213 | |
1214 | /* Find all the appropriate items */ |
1214 | /* Find all the appropriate items */ |
1215 | for (i = 0; i < MAP_WIDTH (op->map); i++) |
1215 | for (i = 0; i < op->map->width; i++) |
1216 | { |
1216 | { |
1217 | for (j = 0; j < MAP_HEIGHT (op->map); j++) |
1217 | for (j = 0; j < op->map->height; j++) |
1218 | { |
1218 | { |
1219 | /* magic map code now centers the map on the object at MAGIC_MAP_HALF. |
1219 | /* magic map code now centers the map on the object at MAGIC_MAP_HALF. |
1220 | * |
1220 | * |
1221 | */ |
1221 | */ |
1222 | nx = i - op->x + MAGIC_MAP_HALF; |
1222 | nx = i - op->x + MAGIC_MAP_HALF; |
… | |
… | |
1225 | if (nx < 0 || ny < 0 || nx > MAGIC_MAP_SIZE || ny > MAGIC_MAP_SIZE) |
1225 | if (nx < 0 || ny < 0 || nx > MAGIC_MAP_SIZE || ny > MAGIC_MAP_SIZE) |
1226 | continue; |
1226 | continue; |
1227 | |
1227 | |
1228 | if (map_mark[nx + MAGIC_MAP_SIZE * ny] & FACE_FLOOR) |
1228 | if (map_mark[nx + MAGIC_MAP_SIZE * ny] & FACE_FLOOR) |
1229 | { |
1229 | { |
1230 | stack = get_map_ob (op->map, i, j); |
1230 | stack = GET_MAP_OB (op->map, i, j); |
1231 | |
1231 | |
1232 | while (stack) |
1232 | while (stack) |
1233 | { |
1233 | { |
1234 | if (QUERY_FLAG (stack, FLAG_UNPAID)) |
1234 | if (QUERY_FLAG (stack, FLAG_UNPAID)) |
1235 | { |
1235 | { |
… | |
… | |
1289 | |
1289 | |
1290 | /* elmex: this function checks whether we are in a shop or not */ |
1290 | /* elmex: this function checks whether we are in a shop or not */ |
1291 | bool |
1291 | bool |
1292 | is_in_shop (maptile *map, int x, int y) |
1292 | is_in_shop (maptile *map, int x, int y) |
1293 | { |
1293 | { |
1294 | for (object *floor = get_map_ob (map, x, y); floor; floor = floor->above) |
1294 | for (object *floor = GET_MAP_OB (map, x, y); floor; floor = floor->above) |
1295 | if (floor->type == SHOP_FLOOR) |
1295 | if (floor->type == SHOP_FLOOR) |
1296 | return true; |
1296 | return true; |
1297 | |
1297 | |
1298 | return false; |
1298 | return false; |
1299 | } |
1299 | } |