… | |
… | |
228 | return 0; |
228 | return 0; |
229 | } |
229 | } |
230 | free (buf); |
230 | free (buf); |
231 | } |
231 | } |
232 | return 1; |
232 | return 1; |
233 | } |
|
|
234 | |
|
|
235 | void |
|
|
236 | destroy_object (object *op) |
|
|
237 | { |
|
|
238 | object *tmp; |
|
|
239 | |
|
|
240 | while ((tmp = op->inv)) |
|
|
241 | destroy_object (tmp); |
|
|
242 | |
|
|
243 | if (!QUERY_FLAG (op, FLAG_REMOVED)) |
|
|
244 | op->remove (); |
|
|
245 | op->destroy (0); |
|
|
246 | } |
233 | } |
247 | |
234 | |
248 | /* |
235 | /* |
249 | * If flag is set, it's only backup, ie dont remove objects from inventory |
236 | * If flag is set, it's only backup, ie dont remove objects from inventory |
250 | * If BACKUP_SAVE_AT_HOME is set, and the flag is set, then the player |
237 | * If BACKUP_SAVE_AT_HOME is set, and the flag is set, then the player |
… | |
… | |
391 | |
378 | |
392 | CLEAR_FLAG (op, FLAG_NO_FIX_PLAYER); |
379 | CLEAR_FLAG (op, FLAG_NO_FIX_PLAYER); |
393 | |
380 | |
394 | if (!flag) |
381 | if (!flag) |
395 | while ((tmp = op->inv)) |
382 | while ((tmp = op->inv)) |
396 | destroy_object (tmp); |
383 | tmp->destroy (1); |
397 | |
384 | |
398 | /* Eneq(@csd.uu.se): Reveal the container if we have one. */ |
385 | /* Eneq(@csd.uu.se): Reveal the container if we have one. */ |
399 | if (flag && container != NULL) |
386 | if (flag && container != NULL) |
400 | op->container = container; |
387 | op->container = container; |
401 | |
388 | |