… | |
… | |
1162 | { |
1162 | { |
1163 | has_unpaid = true; |
1163 | has_unpaid = true; |
1164 | break; |
1164 | break; |
1165 | } |
1165 | } |
1166 | |
1166 | |
1167 | if (op->type != PLAYER) |
1167 | if (!op->is_player ()) |
1168 | { |
1168 | { |
1169 | /* Remove all the unpaid objects that may be carried here. |
1169 | /* Remove all the unpaid objects that may be carried here. |
1170 | * This could be pets or monsters that are somehow in |
1170 | * This could be pets or monsters that are somehow in |
1171 | * the shop. |
1171 | * the shop. |
1172 | */ |
1172 | */ |
… | |
… | |
1176 | |
1176 | |
1177 | if (QUERY_FLAG (tmp, FLAG_UNPAID)) |
1177 | if (QUERY_FLAG (tmp, FLAG_UNPAID)) |
1178 | { |
1178 | { |
1179 | int i = find_free_spot (tmp, op->map, op->x, op->y, 1, 9); |
1179 | int i = find_free_spot (tmp, op->map, op->x, op->y, 1, 9); |
1180 | |
1180 | |
|
|
1181 | if (i >= 0) |
1181 | tmp->remove (); |
1182 | tmp->move (i); |
1182 | |
|
|
1183 | if (i == -1) |
|
|
1184 | i = 0; |
|
|
1185 | |
|
|
1186 | tmp->map = op->map; |
|
|
1187 | tmp->x = op->x + freearr_x[i]; |
|
|
1188 | tmp->y = op->y + freearr_y[i]; |
|
|
1189 | insert_ob_in_map (tmp, op->map, op, 0); |
|
|
1190 | } |
1183 | } |
1191 | } |
1184 | } |
1192 | |
1185 | |
1193 | /* Don't teleport things like spell effects */ |
1186 | /* Don't teleport things like spell effects */ |
1194 | if (QUERY_FLAG (op, FLAG_NO_PICK)) |
1187 | if (QUERY_FLAG (op, FLAG_NO_PICK)) |
… | |
… | |
1205 | if (i != -1) |
1198 | if (i != -1) |
1206 | rv = transfer_ob (op, op->x + freearr_x[i], op->y + freearr_y[i], 0, shop_mat); |
1199 | rv = transfer_ob (op, op->x + freearr_x[i], op->y + freearr_y[i], 0, shop_mat); |
1207 | |
1200 | |
1208 | return 0; |
1201 | return 0; |
1209 | } |
1202 | } |
|
|
1203 | |
1210 | /* Removed code that checked for multipart objects - it appears that |
1204 | /* Removed code that checked for multipart objects - it appears that |
1211 | * the teleport function should be able to handle this just fine. |
1205 | * the teleport function should be able to handle this just fine. |
1212 | */ |
1206 | */ |
1213 | rv = teleport (shop_mat, SHOP_MAT, op); |
1207 | rv = teleport (shop_mat, SHOP_MAT, op); |
1214 | } |
1208 | } |