… | |
… | |
1241 | * job preparing multi-part monsters. |
1241 | * job preparing multi-part monsters. |
1242 | */ |
1242 | */ |
1243 | object * |
1243 | object * |
1244 | insert_ob_in_map_at (object *op, maptile *m, object *originator, int flag, int x, int y) |
1244 | insert_ob_in_map_at (object *op, maptile *m, object *originator, int flag, int x, int y) |
1245 | { |
1245 | { |
|
|
1246 | op->remove (); |
|
|
1247 | |
1246 | for (object *tmp = op->head_ (); tmp; tmp = tmp->more) |
1248 | for (object *tmp = op->head_ (); tmp; tmp = tmp->more) |
1247 | { |
1249 | { |
1248 | tmp->x = x + tmp->arch->x; |
1250 | tmp->x = x + tmp->arch->x; |
1249 | tmp->y = y + tmp->arch->y; |
1251 | tmp->y = y + tmp->arch->y; |
1250 | } |
1252 | } |
… | |
… | |
1273 | * just 'op' otherwise |
1275 | * just 'op' otherwise |
1274 | */ |
1276 | */ |
1275 | object * |
1277 | object * |
1276 | insert_ob_in_map (object *op, maptile *m, object *originator, int flag) |
1278 | insert_ob_in_map (object *op, maptile *m, object *originator, int flag) |
1277 | { |
1279 | { |
|
|
1280 | if (op->is_on_map ()) |
|
|
1281 | { |
|
|
1282 | LOG (llevError, "insert_ob_in_map called for object already on map"); |
|
|
1283 | abort (); |
|
|
1284 | } |
|
|
1285 | |
|
|
1286 | if (op->env) |
|
|
1287 | { |
|
|
1288 | LOG (llevError, "insert_ob_in_map called for object in an inventory (proceeding)"); |
1278 | op->remove (); |
1289 | op->remove (); |
|
|
1290 | } |
1279 | |
1291 | |
1280 | /* Ideally, the caller figures this out. However, it complicates a lot |
1292 | /* Ideally, the caller figures this out. However, it complicates a lot |
1281 | * of areas of callers (eg, anything that uses find_free_spot would now |
1293 | * of areas of callers (eg, anything that uses find_free_spot would now |
1282 | * need extra work |
1294 | * need extra work |
1283 | */ |
1295 | */ |