if( ( pc->regen <= currenttime ) || (overflow) )
if( pc->regen <= currenttime )
void genericCheck(P_CHAR pc, unsigned int currenttime)// Char mapRegions{	if( !pc )		return;		if( !pc->dead )	{		if( pc->hp > pc->st )		{			pc->hp = pc->st;			pc->updateHealth();		}		if( pc->stm > pc->effDex() )		{			pc->stm = pc->effDex();			pc->socket()->updateStamina();		}		if (pc->mn>pc->in)		{			pc->mn = pc->in;			pc->socket()->updateMana();		}		// Health regeneration		if( ( pc->regen <= currenttime ) || (overflow) )		{			UINT32 interval = SrvParams->hitpointrate() * MY_CLOCKS_PER_SEC;			// If it's not disabled hunger affects our health regeneration			if( pc->hp < pc->st && pc->hunger() > 3 || SrvParams->hungerRate() == 0 )			{				for( UINT16 c = 0; c < pc->st + 1; ++c )				{					if( pc->regen + ( c * interval ) <= currenttime && pc->hp <= pc->st )					{						if( pc->skill( HEALING ) < 500 )							pc->hp++;						else if (pc->skill( HEALING ) < 800)							pc->hp += 2;						else 							pc->hp += 3;						if( pc->hp > pc->st )						{							pc->hp = pc->st;							break;						}					}				}				pc->updateHealth();			}			pc->regen = currenttime + interval;		}		// Stamina regeneration		if( ( pc->regen2 <= currenttime ) || overflow )		{			UINT32 interval = SrvParams->staminarate()*MY_CLOCKS_PER_SEC;			for( UINT16 c = 0; c < pc->effDex() + 1; ++c )			{				if (pc->regen2 + (c*interval) <= currenttime && pc->stm <= pc->effDex())				{					pc->stm++;					if (pc->stm>pc->effDex())					{						pc->stm = pc->effDex();						break;					}					pc->socket()->updateStamina();				}			}			pc->regen2 = currenttime + interval;					}		// OSI Style Mana regeneration by blackwind		// if (pc->in>pc->mn)  this leads to the 'mana not subtracted' bug (Duke)		if ((pc->regen3 <= currenttime) || (overflow))		{			unsigned int interval = SrvParams->manarate()*MY_CLOCKS_PER_SEC;			for( UINT16 c = 0; c < pc->in + 1 ; ++c )			{				if (pc->regen3 + (c*interval) <= currenttime && pc->mn <= pc->in)				{				pc->mn++;				if (pc->med() && pc->mn <= pc->mn2)						pc->mn += 5;					if (pc->mn>pc->in)					{						if (pc->med())						{							pc->socket()->sysMessage( tr("You are at peace." ) );							pc->setMed( false );						}						pc->mn = pc->in;						break;					}					pc->socket()->updateMana();				}			}			if (SrvParams->armoraffectmana())			{				int ratio = ( ( 100 + 50 ) / SrvParams->manarate() );				// 100 = Maximum skill (GM)				// 50 = int affects mana regen (%50)				int armorhandicap = ((Skills->GetAntiMagicalArmorDefence(pc) + 1) / SrvParams->manarate());				int charsmeditsecs = (1 + SrvParams->manarate() - ((((pc->skill(MEDITATION) + 1)/10) + ((pc->in + 1) / 2)) / ratio));				if (pc->med())				{					pc->regen3 = currenttime + ((armorhandicap + charsmeditsecs/2)* MY_CLOCKS_PER_SEC);				}				else					pc->regen3 = currenttime + ((armorhandicap + charsmeditsecs)* MY_CLOCKS_PER_SEC);			}			else 				pc->regen3 = currenttime + interval;			}			// end Mana regeneration						if ((pc->hidden() == 2) && ((pc->invistimeout() <= currenttime) || (overflow)) && (!(pc->priv2&8)))			{// only if not permanently hidden - AntiChrist				pc->setHidden( 0 );				pc->setStealth(-1);				pc->resend( false );			}	}	// Check if the character died	if( pc->hp <= 0 && !pc->dead )		pc->kill();}