… | |
… | |
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 | } |
… | |
… | |
960 | return; |
960 | return; |
961 | |
961 | |
962 | if (destroy_inventory) |
962 | if (destroy_inventory) |
963 | destroy_inv (false); |
963 | destroy_inv (false); |
964 | |
964 | |
|
|
965 | if (is_head ()) |
|
|
966 | if (sound_destroy) |
|
|
967 | play_sound (sound_destroy); |
|
|
968 | else if (flag [FLAG_MONSTER]) |
|
|
969 | play_sound (sound_find ("monster_destroy")); // quick hack, too lazy to create a generic mechanism |
|
|
970 | |
965 | attachable::destroy (); |
971 | attachable::destroy (); |
966 | } |
972 | } |
967 | |
973 | |
968 | /* |
974 | /* |
969 | * sub_weight() recursively (outwards) subtracts a number from the |
975 | * sub_weight() recursively (outwards) subtracts a number from the |
… | |
… | |
1089 | { |
1095 | { |
1090 | /* No point updating the players look faces if he is the object |
1096 | /* No point updating the players look faces if he is the object |
1091 | * being removed. |
1097 | * being removed. |
1092 | */ |
1098 | */ |
1093 | |
1099 | |
1094 | if (tmp->type == PLAYER && tmp != this) |
1100 | if (tmp->type == PLAYER && tmp->container == this) |
1095 | { |
|
|
1096 | /* If a container that the player is currently using somehow gets |
1101 | /* If a container that the player is currently using somehow gets |
1097 | * removed (most likely destroyed), update the player view |
1102 | * removed (most likely destroyed), update the player view |
1098 | * appropriately. |
1103 | * appropriately. |
1099 | */ |
1104 | */ |
1100 | if (tmp->container == this) |
|
|
1101 | { |
|
|
1102 | flag [FLAG_APPLIED] = 0; |
|
|
1103 | tmp->container = 0; |
1105 | tmp->close_container (); |
1104 | } |
|
|
1105 | |
|
|
1106 | if (tmp->contr->ns) |
|
|
1107 | tmp->contr->ns->floorbox_update (); |
|
|
1108 | } |
|
|
1109 | |
1106 | |
1110 | /* See if object moving off should effect something */ |
1107 | /* See if object moving off should effect something */ |
1111 | if (check_walk_off |
1108 | if (check_walk_off |
1112 | && ((move_type & tmp->move_off) |
1109 | && ((move_type & tmp->move_off) |
1113 | && (move_type & ~tmp->move_off & ~tmp->move_block) == 0)) |
1110 | && (move_type & ~tmp->move_off & ~tmp->move_block) == 0)) |
… | |
… | |
1375 | */ |
1372 | */ |
1376 | if (last && last->below && last != floor) |
1373 | if (last && last->below && last != floor) |
1377 | top = last->below; |
1374 | top = last->below; |
1378 | } |
1375 | } |
1379 | } /* If objects on this space */ |
1376 | } /* If objects on this space */ |
1380 | |
|
|
1381 | if (flag & INS_MAP_LOAD) |
1377 | if (flag & INS_MAP_LOAD) |
1382 | top = ms.top; |
1378 | top = ms.top; |
1383 | |
1379 | |
1384 | if (flag & INS_ABOVE_FLOOR_ONLY) |
1380 | if (flag & INS_ABOVE_FLOOR_ONLY) |
1385 | top = floor; |
1381 | top = floor; |
… | |
… | |
2729 | force->flag [FLAG_APPLIED] = true; |
2725 | force->flag [FLAG_APPLIED] = true; |
2730 | |
2726 | |
2731 | insert (force); |
2727 | insert (force); |
2732 | } |
2728 | } |
2733 | |
2729 | |
2734 | |
|
|