--- deliantra/server/common/loader.C 2008/05/06 16:32:34 1.116 +++ deliantra/server/common/loader.C 2008/09/14 23:13:25 1.121 @@ -387,18 +387,28 @@ #endif } - /* Old spellcasting object - need to load in the appropiate object */ - if ((type == ROD || type == WAND || type == SCROLL || type == HORN || type == FIREWALL || + /* old style spellcasting object (pretty common) - need to load in the appropiate object */ + /* (schmorp) old really doesn't mean old, imho, just a more compact way to store such objects */ + if ((type == ROD + || type == WAND + || type == SCROLL + || type == HORN + || type == FIREWALL /* POTIONS and ALTARS don't always cast spells, but if they do, update them */ - ((type == POTION || type == ALTAR) && stats.sp)) && !inv && !loading_arch) + || ((type == POTION || type == ALTAR) && stats.sp)) // watchout: sp = 0 is still magic bullet. + && !inv + && !loading_arch + && stats.sp) // watchout: old magic bullet stuff directly on the map is going to break here! + // TODO: at least one watchout-comments is redundant - investigate/remove { + // TODO: fix firewall object on map /* Firewall is bizarre in that spell type was stored in dam. Rest are 'normal' * in that spell was stored in sp. */ - LOG (llevError, "old spellcasting object found: %s", debug_desc ()); + //LOG (llevError, "old spellcasting object found: %s", debug_desc ()); object *tmp = get_archetype (spell_mapping[type == FIREWALL ? stats.dam : stats.sp]); insert_ob_in_ob (tmp, this); - randomitems = NULL; /* So another spell isn't created for this object */ + randomitems = 0; } /* spellbooks & runes use slaying. But not to arch name, but to spell name */ @@ -552,11 +562,10 @@ case KW_tag: f.get_ornull (tag); break; case KW_arch: - { - object *tmp = object::read (f); - tmp->deactivate (); - + if (object *tmp = object::read (f)) { + tmp->deactivate (); + // was: insert_ob_in_ob (tmp, op); // but manually adding it can improve map loading times a lot // also, appending instead of prepending keeps the @@ -583,7 +592,6 @@ tmp->env = this; op_inv = tmp; } - } continue; case KW_other_arch: @@ -923,7 +931,10 @@ case KW_weapontype: f.get (weapontype); break; case KW_tooltype: f.get (tooltype); break; case KW_casting_time: f.get (casting_time); break; - case KW_elevation: f.get (elevation); break; + + // elevation is deprecated + case KW_elevation: break; + case KW_smoothlevel: f.get (smoothlevel); smoothlevel = clamp (smoothlevel, 0, 255); break; case KW_client_type: f.get (client_type); break; case KW_duration: f.get (duration); break; @@ -1379,7 +1390,6 @@ CMP_OUT (smoothlevel); CMP_OUT (weapontype); CMP_OUT (tooltype); - CMP_OUT (elevation); CMP_OUT (client_type); CMP_OUT (item_power); CMP_OUT (duration);