… | |
… | |
215 | if (ms.blocks (move_type)) |
215 | if (ms.blocks (move_type)) |
216 | return 1; |
216 | return 1; |
217 | } |
217 | } |
218 | |
218 | |
219 | return 0; |
219 | return 0; |
220 | } |
|
|
221 | |
|
|
222 | /* When the map is loaded, load_object does not actually insert objects |
|
|
223 | * into inventory, but just links them. What this does is go through |
|
|
224 | * and insert them properly. |
|
|
225 | * The object 'container' is the object that contains the inventory. |
|
|
226 | * This is needed so that we can update the containers weight. |
|
|
227 | */ |
|
|
228 | static void |
|
|
229 | fix_container (object *container) |
|
|
230 | { |
|
|
231 | object *tmp = container->inv, *next; |
|
|
232 | |
|
|
233 | container->inv = 0; |
|
|
234 | while (tmp) |
|
|
235 | { |
|
|
236 | next = tmp->below; |
|
|
237 | if (tmp->inv) |
|
|
238 | fix_container (tmp); |
|
|
239 | |
|
|
240 | insert_ob_in_ob (tmp, container); |
|
|
241 | tmp = next; |
|
|
242 | } |
|
|
243 | |
|
|
244 | // go through and calculate what all the containers are carrying. |
|
|
245 | //TODO: remove |
|
|
246 | container->update_weight (); |
|
|
247 | } |
220 | } |
248 | |
221 | |
249 | //-GPL |
222 | //-GPL |
250 | |
223 | |
251 | void |
224 | void |