28 Jan, 2013, arholly wrote in the 1st comment:
Votes: 0
Hello:
I am not sure why, but my mud is not loading areas when it starts up, but will load them after you startup and let the mud sit for a little bit (naturally resetting). I can also force an area to reset and it does, but just not when the Mud startups. Any thoughts on where I should look or why it would do that?

Thanks in advance,
Arholly
28 Jan, 2013, Rarva.Riendf wrote in the 2nd comment:
Votes: 0
Look at the end of your void boot_db(bool_t fCopyOver) method in db.c
You should have something looking like that:
{
fix_exits( );
fBootDb = FALSE;
area_update( ); //the area are updated here
load_notes( );
MOBtrigger = TRUE;
}
28 Jan, 2013, arholly wrote in the 3rd comment:
Votes: 0
/*
* Generate shop for news stands and apply it to news stand mob indices.
*/
apply_newsstands();

/*
* Fix up exits.
* Declare db booting over.
* Reset all areas once.
* Load up the notes and ban files.
*/
{
fix_exits();
fix_mobprogs();
prep_vehicles();
fBootDb = FALSE;
area_update();
load_notes();
load_papers();
load_bans();
//load_votes();
load_stocks();
load_social_table();
}

return;
}

Yes, I have that. However, it is not doing it. :(
29 Jan, 2013, Rarva.Riendf wrote in the 4th comment:
Votes: 0
heh if you have that I am pretty sure it is doing it, just not what you think it should do :) (unless your areas are not loaded in this method but that would be surprising)
Maybe it only update areas when a player is loaded. (
Check in the area_update method.
for (pArea = area_first;pArea;pArea = pArea->next) {
if ( ++pArea->age < 3) //if you want your area to be 'forced' update at boot because loading the area itself is not enough, just set their age to 4 at boot.
continue;
[code]
29 Jan, 2013, arholly wrote in the 5th comment:
Votes: 0
But my load_area does have the age set to higher than 3.
void load_area( FILE *fp )
{
AREA_DATA *pArea;

pArea = new_area();
/* pArea->reset_first = NULL;
pArea->reset_last = NULL; */
pArea->file_name = fread_string(fp);

pArea->area_flags = AREA_LOADING; /* OLC */
pArea->security = 9; /* OLC */ /* 9 – Hugin */
PURGE_DATA(pArea->builders);
pArea->builders = str_dup( "None" ); /* OLC */
pArea->vnum = top_area; /* OLC */

pArea->name = fread_string( fp );
pArea->credits = fread_string( fp );
pArea->min_vnum = fread_number( fp );
pArea->max_vnum = fread_number( fp );
/* pArea->area_version = fread_number( fp ); */
pArea->age = 15;
pArea->nplayer = 0;
pArea->empty = FALSE;

if ( !area_first )
area_first = pArea;
if ( area_last )
{
area_last->next = pArea;
REMOVE_BIT(area_last->area_flags, AREA_LOADING); /* OLC */
}
area_last = pArea;
pArea->next = NULL;
current_area = pArea;

top_area++;
return;
}
29 Jan, 2013, Rarva.Riendf wrote in the 6th comment:
Votes: 0
Check what your area update code does then.
30 Jan, 2013, arholly wrote in the 7th comment:
Votes: 0
This is my area_update.
void area_update( void )
{
AREA_DATA *pArea;

for ( pArea = area_first; pArea != NULL; pArea = pArea->next )
{

if ( ++pArea->age < 3 )
continue;

/*
* Check age and reset.
* Note: Mud School resets every 3 minutes (not 15).
*/
if ( (!pArea->empty && (pArea->nplayer == 0 || pArea->age >= 10)) || pArea->age >= 31)
{
ROOM_INDEX_DATA *pRoomIndex;

reset_area( pArea );
wiznet((char *)Format("\tY[WIZNET]\tn %s has just been reset.",pArea->name),NULL,NULL,WIZ_RESETS,0,0);

pArea->age = number_range( 0, 3 );
pRoomIndex = get_room_index( ROOM_VNUM_START );
if ( pRoomIndex != NULL && pArea == pRoomIndex->area )
pArea->age = 15 - 2;
else if (pArea->nplayer == 0)
pArea->empty = TRUE;
}
}

return;
}
30 Jan, 2013, Rarva.Riendf wrote in the 8th comment:
Votes: 0
reset_area( pArea ); is where it happens, where it should loop through all area room vnum and reset every room.
So follow reset_room and see what happens there etc…

And learn to use gdb and follow your code step by step. You probably have a test somewhere that just returns if a value is not set, hence doing nothing till you force it manually.
01 Feb, 2013, arholly wrote in the 9th comment:
Votes: 0
Ok, but it is resetting the area, just not when the mud starts up. If I let it go, it resets the areas naturally, just not on startup, which is why I'm confused.
01 Feb, 2013, Rarva.Riendf wrote in the 10th comment:
Votes: 0
Learn to launch your code with breakpoint, put the first one at you reset_area in boot_db and follow you code step by step. You will see where it returns (and thus why)

If you don't know how to use GDB and breakpoints , I suggest you stop doing anything and learn that before you do anything else.
Because you wil keep asking questions like these where we cannot help you because either you don't know wich code to paste, or what are the values used by the code at this point.
In your other thread, I told you wich value was NULL, and you still asked why it crashed. Something tells me you don't understand what you are doing at all.
0.0/10