… | |
… | |
299 | return 0; |
299 | return 0; |
300 | else if (!compare_ob_value_lists (ob1, ob2)) |
300 | else if (!compare_ob_value_lists (ob1, ob2)) |
301 | return 0; |
301 | return 0; |
302 | } |
302 | } |
303 | |
303 | |
304 | //TODO: generate an event or call into perl for additional checks |
|
|
305 | if (ob1->self || ob2->self) |
304 | if (ob1->self || ob2->self) |
306 | { |
305 | { |
307 | ob1->optimise (); |
306 | ob1->optimise (); |
308 | ob2->optimise (); |
307 | ob2->optimise (); |
309 | |
308 | |
310 | if (ob1->self || ob2->self) |
309 | if (ob1->self || ob2->self) |
|
|
310 | if (!cfperl_can_merge (ob1, ob2)) |
311 | return 0; |
311 | return 0; |
312 | } |
312 | } |
313 | |
313 | |
314 | /* Everything passes, must be OK. */ |
314 | /* Everything passes, must be OK. */ |
315 | return 1; |
315 | return 1; |
316 | } |
316 | } |
… | |
… | |
959 | if (destroyed ()) |
959 | if (destroyed ()) |
960 | return; |
960 | return; |
961 | |
961 | |
962 | if (destroy_inventory) |
962 | if (destroy_inventory) |
963 | destroy_inv (false); |
963 | destroy_inv (false); |
|
|
964 | |
|
|
965 | if (sound_destroy) |
|
|
966 | play_sound (sound_destroy); |
|
|
967 | else if (flag [FLAG_MONSTER]) |
|
|
968 | play_sound (sound_find ("monster_destroy")); // quick hack, too lazy to create a generic mechanism |
964 | |
969 | |
965 | attachable::destroy (); |
970 | attachable::destroy (); |
966 | } |
971 | } |
967 | |
972 | |
968 | /* |
973 | /* |
… | |
… | |
1375 | */ |
1380 | */ |
1376 | if (last && last->below && last != floor) |
1381 | if (last && last->below && last != floor) |
1377 | top = last->below; |
1382 | top = last->below; |
1378 | } |
1383 | } |
1379 | } /* If objects on this space */ |
1384 | } /* If objects on this space */ |
1380 | |
|
|
1381 | if (flag & INS_MAP_LOAD) |
1385 | if (flag & INS_MAP_LOAD) |
1382 | top = ms.top; |
1386 | top = ms.top; |
1383 | |
1387 | |
1384 | if (flag & INS_ABOVE_FLOOR_ONLY) |
1388 | if (flag & INS_ABOVE_FLOOR_ONLY) |
1385 | top = floor; |
1389 | top = floor; |
… | |
… | |
2640 | } |
2644 | } |
2641 | |
2645 | |
2642 | const materialtype_t * |
2646 | const materialtype_t * |
2643 | object::dominant_material () const |
2647 | object::dominant_material () const |
2644 | { |
2648 | { |
2645 | if (materialtype_t *mat = name_to_material (materialname)) |
2649 | if (materialtype_t *mt = name_to_material (materialname)) |
2646 | return mat; |
2650 | return mt; |
2647 | |
2651 | |
2648 | // omfg this is slow, this has to be temporary :) |
|
|
2649 | shstr unknown ("unknown"); |
|
|
2650 | |
|
|
2651 | return name_to_material (unknown); |
2652 | return name_to_material (shstr_unknown); |
2652 | } |
2653 | } |
2653 | |
2654 | |
2654 | void |
2655 | void |
2655 | object::open_container (object *new_container) |
2656 | object::open_container (object *new_container) |
2656 | { |
2657 | { |
… | |
… | |
2732 | force->flag [FLAG_APPLIED] = true; |
2733 | force->flag [FLAG_APPLIED] = true; |
2733 | |
2734 | |
2734 | insert (force); |
2735 | insert (force); |
2735 | } |
2736 | } |
2736 | |
2737 | |
2737 | |
|
|