… | |
… | |
206 | SET_FLAG (ob1, FLAG_BEEN_APPLIED); |
206 | SET_FLAG (ob1, FLAG_BEEN_APPLIED); |
207 | |
207 | |
208 | if (QUERY_FLAG (ob2, FLAG_IDENTIFIED)) |
208 | if (QUERY_FLAG (ob2, FLAG_IDENTIFIED)) |
209 | SET_FLAG (ob2, FLAG_BEEN_APPLIED); |
209 | SET_FLAG (ob2, FLAG_BEEN_APPLIED); |
210 | |
210 | |
211 | if (ob1->arch->name != ob2->arch->name |
211 | if (ob1->arch->archname != ob2->arch->archname |
212 | || ob1->name != ob2->name |
212 | || ob1->name != ob2->name |
213 | || ob1->title != ob2->title |
213 | || ob1->title != ob2->title |
214 | || ob1->msg != ob2->msg |
214 | || ob1->msg != ob2->msg |
215 | || ob1->weight != ob2->weight |
215 | || ob1->weight != ob2->weight |
216 | || ob1->attacktype != ob2->attacktype |
216 | || ob1->attacktype != ob2->attacktype |
217 | || ob1->magic != ob2->magic |
217 | || ob1->magic != ob2->magic |
218 | || ob1->slaying != ob2->slaying |
218 | || ob1->slaying != ob2->slaying |
219 | || ob1->skill != ob2->skill |
219 | || ob1->skill != ob2->skill |
220 | || ob1->value != ob2->value |
220 | || ob1->value != ob2->value |
221 | || ob1->animation_id != ob2->animation_id |
221 | || ob1->animation_id != ob2->animation_id |
|
|
222 | || (ob1->face != ob2->face && !ob1->animation_id) // face and animation are dependent on each other |
222 | || ob1->client_type != ob2->client_type |
223 | || ob1->client_type != ob2->client_type |
223 | || ob1->materialname != ob2->materialname |
224 | || ob1->materialname != ob2->materialname |
224 | || ob1->lore != ob2->lore |
225 | || ob1->lore != ob2->lore |
225 | || ob1->subtype != ob2->subtype |
226 | || ob1->subtype != ob2->subtype |
226 | || ob1->move_type != ob2->move_type |
227 | || ob1->move_type != ob2->move_type |
… | |
… | |
478 | */ |
479 | */ |
479 | object * |
480 | object * |
480 | find_object_name (const char *str) |
481 | find_object_name (const char *str) |
481 | { |
482 | { |
482 | shstr_cmp str_ (str); |
483 | shstr_cmp str_ (str); |
483 | object *op; |
|
|
484 | |
484 | |
|
|
485 | if (str_) |
485 | for_all_objects (op) |
486 | for_all_objects (op) |
486 | if (op->name == str_) |
487 | if (op->name == str_) |
487 | break; |
488 | return op; |
488 | |
489 | |
489 | return op; |
490 | return 0; |
490 | } |
491 | } |
491 | |
492 | |
492 | /* |
493 | /* |
493 | * Sets the owner and sets the skill and exp pointers to owner's current |
494 | * Sets the owner and sets the skill and exp pointers to owner's current |
494 | * skill and experience objects. |
495 | * skill and experience objects. |
… | |
… | |
1236 | * job preparing multi-part monsters. |
1237 | * job preparing multi-part monsters. |
1237 | */ |
1238 | */ |
1238 | object * |
1239 | object * |
1239 | insert_ob_in_map_at (object *op, maptile *m, object *originator, int flag, int x, int y) |
1240 | insert_ob_in_map_at (object *op, maptile *m, object *originator, int flag, int x, int y) |
1240 | { |
1241 | { |
|
|
1242 | op->remove (); |
|
|
1243 | |
1241 | for (object *tmp = op->head_ (); tmp; tmp = tmp->more) |
1244 | for (object *tmp = op->head_ (); tmp; tmp = tmp->more) |
1242 | { |
1245 | { |
1243 | tmp->x = x + tmp->arch->x; |
1246 | tmp->x = x + tmp->arch->x; |
1244 | tmp->y = y + tmp->arch->y; |
1247 | tmp->y = y + tmp->arch->y; |
1245 | } |
1248 | } |
… | |
… | |
1268 | * just 'op' otherwise |
1271 | * just 'op' otherwise |
1269 | */ |
1272 | */ |
1270 | object * |
1273 | object * |
1271 | insert_ob_in_map (object *op, maptile *m, object *originator, int flag) |
1274 | insert_ob_in_map (object *op, maptile *m, object *originator, int flag) |
1272 | { |
1275 | { |
|
|
1276 | if (op->is_on_map ()) |
|
|
1277 | { |
|
|
1278 | LOG (llevError, "insert_ob_in_map called for object already on map"); |
|
|
1279 | abort (); |
|
|
1280 | } |
|
|
1281 | |
|
|
1282 | if (op->env) |
|
|
1283 | { |
|
|
1284 | LOG (llevError, "insert_ob_in_map called for object in an inventory (proceeding)"); |
1273 | op->remove (); |
1285 | op->remove (); |
|
|
1286 | } |
|
|
1287 | |
|
|
1288 | if (op->face && !face_info (op->face))//D TODO: remove soon |
|
|
1289 | {//D |
|
|
1290 | LOG (llevError | logBacktrace, "op->face out of bounds: %s", op->debug_desc ());//D |
|
|
1291 | op->face = 1;//D |
|
|
1292 | }//D |
1274 | |
1293 | |
1275 | /* Ideally, the caller figures this out. However, it complicates a lot |
1294 | /* Ideally, the caller figures this out. However, it complicates a lot |
1276 | * of areas of callers (eg, anything that uses find_free_spot would now |
1295 | * of areas of callers (eg, anything that uses find_free_spot would now |
1277 | * need extra work |
1296 | * need extra work |
1278 | */ |
1297 | */ |