1 | /* |
1 | /* |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2005,2006,2007,2008,2009,2010,2011 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2002 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2002 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992 Frank Tore Johansen |
6 | * Copyright (©) 1992 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
9 | * the terms of the Affero GNU General Public License as published by the |
9 | * the terms of the Affero GNU General Public License as published by the |
… | |
… | |
357 | } |
357 | } |
358 | |
358 | |
359 | void |
359 | void |
360 | archetype::post_load_check () |
360 | archetype::post_load_check () |
361 | { |
361 | { |
|
|
362 | assert (("obj_original MUST NOT be set for archetypes", !flag [FLAG_OBJ_ORIGINAL])); |
|
|
363 | |
|
|
364 | if (type == SKILL) |
|
|
365 | add_skill_archetype (this); |
|
|
366 | |
362 | object::post_load_check (); |
367 | object::post_load_check (); |
363 | |
|
|
364 | assert (("obj_original MUST NOT be set for archetypes", !flag [FLAG_OBJ_ORIGINAL])); |
|
|
365 | } |
368 | } |
366 | |
369 | |
367 | archetype * |
370 | archetype * |
368 | archetype::read (object_thawer &f) |
371 | archetype::read (object_thawer &f) |
369 | { |
372 | { |
… | |
… | |
546 | |
549 | |
547 | if (at->refcnt_cnt () > 1) // all arches have ONE refcount from their object |
550 | if (at->refcnt_cnt () > 1) // all arches have ONE refcount from their object |
548 | ++idx; |
551 | ++idx; |
549 | else |
552 | else |
550 | { |
553 | { |
551 | LOG (llevDebug, "garbage collect arch %s", &at->archname); |
554 | //LOG (llevDebug, "garbage collect arch %s", &at->archname); |
552 | assert (at->arch == at); // verify that refcnt == 1 is truly valid |
555 | assert (at->arch == at); // verify that refcnt == 1 is truly valid |
553 | allarch.erase (idx); |
556 | allarch.erase (idx); |
554 | |
557 | |
555 | // break chain |
558 | // break chain |
556 | for (object *op = at->head_ (); op; ) |
559 | for (object *op = at->head_ (); op; ) |