#define PULSE_PER_SECOND 4
#define PULSE_AREA (120 * PULSE_PER_SECOND)
if ( –pulse_area <= 0 )
{
pulse_area = PULSE_AREA;
area_update ( );
}
/*
* Repopulate areas periodically.
*/
void area_update( void )
{
AREA_DATA *pArea;
char buf[MAX_STRING_LENGTH];
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 >= 15))
|| pArea->age >= 31) // Meaning - Empty, repop in 5 minutes, player found repop in 15
{
ROOM_INDEX_DATA *pRoomIndex;
reset_area( pArea );
sprintf(buf,"%s has just been reset.",pArea->name);
wiznet(buf,NULL,NULL,WIZ_RESETS,0,0);
pArea->age = number_range( 0, 3 ); //Restart it 'roughly' at 0, with variation
pRoomIndex = get_room_index( ROOM_VNUM_SCHOOL );
if ( pRoomIndex != NULL && pArea == pRoomIndex->area )
pArea->age = 15 - 2;// Unless it's the school, then we start a shorter countdown
else if (pArea->nplayer == 0)
pArea->empty = TRUE;
}
}
return;
}
else if (pArea->nplayer == 0)
pArea->empty = TRUE;
if ( (!pArea->empty && (pArea->nplayer == 0 || pArea->age >= 15)) || pArea->age >= 31)
if ((!pArea->empty && pArea->age >= 15) || pArea->age >= 31)
Please, can anyone explain the intent of this, and how it works?