pi2->time_unused=0; pi2->timeused_last=getNormalizedTime();
house_item->time_unused=0; house_item->timeused_last=getNormalizedTime();
void dooruse(UOXSOCKET s, ITEM item){	int i, db, x;//, z;	char changed=0;	const P_ITEM pi=MAKE_ITEMREF_LR(item);	// on error return	if ((iteminrange(s,pi,2)==0)&& s>-1) {sysmessage(s, "You cannot reach the handle from here");return;}	for (i=0;i<DOORTYPES;i++)	{		db=doorbase[i];		x=pi->id();		if (x==(db+0))		{			pi->id2++;			pi->pos.x--;			pi->pos.y++;			RefreshItem(pi);			changed=1;			doorsfx(pi, x, 0);			tempeffect2(0, pi, 13, 0, 0, 0);		} else if (x==(db+1))		{			pi->id2--;			pi->pos.x++;			pi->pos.y--;			RefreshItem(pi);//AntiChrist			changed=1;			doorsfx(pi, x, 1);			pi->dooropen=0;		} else if (x==(db+2))		{			pi->id2++;			pi->pos.x++;			pi->pos.y++;			RefreshItem(pi);//AntiChrist			changed=1;			doorsfx(pi, x, 0);			tempeffect2(0, pi, 13, 0, 0, 0);		} else if (x==(db+3))		{			pi->id2--;			pi->pos.x--;			pi->pos.y--;			RefreshItem(pi);//AntiChrist			changed=1;			doorsfx(pi, x, 1);			pi->dooropen=0;		} else if (x==(db+4))		{			pi->id2++;			pi->pos.x--;			RefreshItem(pi);//AntiChrist			changed=1;			doorsfx(pi, x, 0);			tempeffect2(0, pi, 13, 0, 0, 0);		} else if (x==(db+5))		{			pi->id2--;			pi->pos.x++;			RefreshItem(pi);//AntiChrist			changed=1;			doorsfx(pi, x, 1);			pi->dooropen=0;		} else if (x==(db+6))		{			pi->id2++;			pi->pos.x++;			pi->pos.y--;			RefreshItem(pi);//AntiChrist			changed=1;			doorsfx(pi, x, 0);			tempeffect2(0, pi, 13, 0, 0, 0);		} else if (x==(db+7))		{			pi->id2--;			pi->pos.x--;			pi->pos.y++;			RefreshItem(pi);//AntiChrist			changed=1;			doorsfx(pi, x, 1);			pi->dooropen=0;		} else if (x==(db+8))		{			pi->id2++;			pi->pos.x++;			pi->pos.y++;			RefreshItem(pi);//AntiChrist			changed=1;			doorsfx(pi, x, 0);			tempeffect2(0, pi, 13, 0, 0, 0);		} else if (x==(db+9))		{			pi->id2--;			pi->pos.x--;			pi->pos.y--;			RefreshItem(pi);//AntiChrist			changed=1;			doorsfx(pi, x, 1);			pi->dooropen=0;		} else if (x==(db+10))		{			pi->id2++;			pi->pos.x++;			pi->pos.y--;			RefreshItem(pi);//AntiChrist			changed=1;			doorsfx(pi, x, 0);			tempeffect2(0, pi, 13, 0, 0, 0);		} else if (x==(db+11))		{			pi->id2--;			pi->pos.x--;			pi->pos.y++;			RefreshItem(pi);//AntiChrist			changed=1;			doorsfx(pi, x, 1);			pi->dooropen=0;		}		else if (x==(db+12))		{			pi->id2++;			RefreshItem(pi);//AntiChrist			changed=1;			doorsfx(pi, x, 0);			tempeffect2(0, pi, 13, 0, 0, 0);		} else if (x==(db+13))		{			pi->id2--;			RefreshItem(pi);//AntiChrist			changed=1;			doorsfx(pi, x, 1);			pi->dooropen=0;		} else if (x==(db+14))		{			pi->id2++;			pi->pos.y--;			RefreshItem(pi);//AntiChrist			changed=1;			doorsfx(pi, x, 0);			tempeffect2(0, pi, 13, 0, 0, 0);		} else if (x==(db+15))		{			pi->id2--;			pi->pos.y++;			RefreshItem(pi);//AntiChrist			changed=1;			doorsfx(pi, x, 1);			pi->dooropen=0;		}	}		if (changed)	{		// house refreshment when a house owner or friend of a houe opens the house door				P_CHAR pc_currchar = MAKE_CHARREF_LR(currchar[s]);		int house_item,j, houseowner_serial,ds;		house_item = findmulti(pi->pos);		if(house_item!=-1)		{			const P_ITEM pi2=MAKE_ITEMREF_LR(house_item);			if ( ishouse(house_item) )			{				houseowner_serial=pi2->GetOwnSerial();				j=on_hlist(house_item, pc_currchar->ser1, pc_currchar->ser2, pc_currchar->ser3, pc_currchar->ser4, NULL);				if ( j==H_FRIEND || pc_currchar->Owns(pi2) ) // house_refresh stuff, LB, friends of the house can do.				{					if (s!=-1)					{						if (SrvParms->housedecay_secs!=0)							ds=((pi2->time_unused)*100)/(SrvParms->housedecay_secs);						else ds=-1;												if (ds>=50) // sysmessage iff decay status >=50%						{							if (!pc_currchar->Owns(pi2))								sysmessage(s,"You refreshed your friend's house");							else								sysmessage(s,"You refreshed the house");						}					}										pi2->time_unused=0;					pi2->timeused_last=getNormalizedTime();				}				//clConsole.send("house name: %s\n",pi2->name);			} // end of is_house		} // end of is_multi	}	if (changed==0 && s>-1) sysmessage(s, "This doesnt seem to be a valid door type. Contact a GM.");}