save.c
changes/save.c · 2.1 KB
From the archive romolc10.tar.gz
Download the archive « Back to the archive contents
Jason Dinkel
Mar. 27 1995
Modified for ROM OLC
Hans Birkeland
Apr 14 1995
This file contains modifications needed to save.c.
---- fwrite_char
if (ch->trust != 0)
fprintf( fp, "Tru %d\n", ch->trust );
fprintf( fp, "Sec %d\n", ch->pcdata->security ); /* OLC */
fprintf( fp, "Plyd %d\n",
ch->played + (int) (current_time - ch->logon) );
---- load_char_obj
ch->pcdata->condition[COND_FULL] = 48;
ch->pcdata->security = 0; /* OLC */
---- fread_char
KEY( "ShortDescr", ch->short_descr, fread_string( fp ) );
KEY( "ShD", ch->short_descr, fread_string( fp ) );
KEY( "Sec", ch->pcdata->security, fread_number( fp ) ); /* OLC */
---- fread_obj
Replace the test
if ( !fNest || !fVnum || obj->pIndexData == NULL)
{
bug( "Fread_obj: incomplete object.", 0 );
.
.
.
return;
}
else
{
.
.
.
else
obj_to_obj( obj, rgObjNest[iNest-1] );
return;
}
With:
if ( !fNest || ( fVnum && obj->pIndexData == NULL ) )
{
bug( "Fread_obj: incomplete object.", 0 );
free_string( obj->name );
free_string( obj->description );
free_string( obj->short_descr );
obj->next = obj_free;
obj_free = obj;
return;
}
else
{
if ( !fVnum )
{
free_string( obj->name );
free_string( obj->description );
free_string( obj->short_descr );
obj->next = obj_free;
obj_free = obj;
obj = create_object( get_obj_index( OBJ_VNUM_DUMMY ), 0 );
}
if (!new_format)
{
obj->next = object_list;
object_list = obj;
obj->pIndexData->count++;
}
if (!obj->pIndexData->new_format
&& obj->item_type == ITEM_ARMOR
&& obj->value[1] == 0)
{
obj->value[1] = obj->value[0];
obj->value[2] = obj->value[0];
}
if (make_new)
{
int wear;
wear = obj->wear_loc;
extract_obj(obj);
obj = create_object(obj->pIndexData,0);
obj->wear_loc = wear;
}
if ( iNest == 0 || rgObjNest[iNest] == NULL )
obj_to_char( obj, ch );
else
obj_to_obj( obj, rgObjNest[iNest-1] );
return;
}