… | |
… | |
1041 | * the previous environment. |
1041 | * the previous environment. |
1042 | */ |
1042 | */ |
1043 | void |
1043 | void |
1044 | object::do_remove () |
1044 | object::do_remove () |
1045 | { |
1045 | { |
1046 | object *tmp, *last = 0; |
|
|
1047 | object *otmp; |
|
|
1048 | |
|
|
1049 | if (flag [FLAG_REMOVED]) |
1046 | if (flag [FLAG_REMOVED]) |
1050 | return; |
1047 | return; |
1051 | |
1048 | |
1052 | INVOKE_OBJECT (REMOVE, this); |
1049 | INVOKE_OBJECT (REMOVE, this); |
1053 | |
1050 | |
… | |
… | |
1159 | //TODO: update floorbox to preserve ordering |
1156 | //TODO: update floorbox to preserve ordering |
1160 | if (pl->contr->ns) |
1157 | if (pl->contr->ns) |
1161 | pl->contr->ns->floorbox_update (); |
1158 | pl->contr->ns->floorbox_update (); |
1162 | } |
1159 | } |
1163 | |
1160 | |
|
|
1161 | if (check_walk_off) |
1164 | for (tmp = ms.bot; tmp; tmp = tmp->above) |
1162 | for (object *above, *tmp = ms.bot; tmp; tmp = above) |
1165 | { |
1163 | { |
|
|
1164 | above = tmp->above; |
|
|
1165 | |
1166 | /* No point updating the players look faces if he is the object |
1166 | /* No point updating the players look faces if he is the object |
1167 | * being removed. |
1167 | * being removed. |
1168 | */ |
1168 | */ |
1169 | |
1169 | |
1170 | /* See if object moving off should effect something */ |
1170 | /* See if object moving off should effect something */ |
1171 | if (check_walk_off |
|
|
1172 | && ((move_type & tmp->move_off) |
1171 | if ((move_type & tmp->move_off) |
1173 | && (move_type & ~tmp->move_off & ~tmp->move_block) == 0)) |
1172 | && (move_type & ~tmp->move_off & ~tmp->move_block) == 0) |
1174 | { |
|
|
1175 | move_apply (tmp, this, 0); |
1173 | move_apply (tmp, this, 0); |
1176 | |
|
|
1177 | if (destroyed ()) |
|
|
1178 | LOG (llevError, "BUG: remove_ob(): name %s, destroyed leaving object\n", tmp->debug_desc ()); |
|
|
1179 | } |
1174 | } |
1180 | |
|
|
1181 | last = tmp; |
|
|
1182 | } |
|
|
1183 | |
1175 | |
1184 | if (affects_los ()) |
1176 | if (affects_los ()) |
1185 | update_all_los (map, x, y); |
1177 | update_all_los (map, x, y); |
1186 | } |
1178 | } |
1187 | } |
1179 | } |