unsigned long loopexit = 0;
void objTeleporters(int s){	P_CHAR pc_s = MAKE_CHARREF_LR(s);	int x = pc_s->pos.x, y = pc_s->pos.y;		int	StartGrid = mapRegions->StartGrid(pc_s->pos.x, pc_s->pos.y);	//	int	getcell=mapRegions->GetCell(pc_s->x,pc_s->y);		unsigned int increment = 0;	unsigned long loopexit = 0;	for (unsigned int checkgrid = StartGrid + (increment*mapRegions->GetColSize()); increment < 3; increment++, checkgrid = StartGrid + (increment*mapRegions->GetColSize()))	{		for (int a = 0; a < 3; a++)		{			vector<SERIAL> vecEntries = mapRegions->GetCellEntries(checkgrid + a);			for ( unsigned int k = 0; k < vecEntries.size(); k++)			{				P_ITEM pmi = FindItemBySerial(vecEntries[k]);				if (pmi != NULL)				{					if (pmi->pos.x == x && pmi->pos.y == y &&						((abs(pmi->pos.z) + 10) >= abs(pc_s->pos.z)) &&((abs(pmi->pos.z) - 10) <= abs(pc_s->pos.z)))					{						if ((pmi->type == 60) && (pmi->morex + pmi->morey + pmi->morez >0))						{							pc_s->MoveTo(pmi->morex,pmi->morey,pmi->morez);							teleport(s);						}												// advancement objects						if ((pmi->type == 80)&&(pc_s->isPlayer()))							if (pmi->more1 != 0 || pmi->more2 != 0 || pmi->more3 != 0 || pmi->more4 != 0)							{								if (pc_s->ser1 == pmi->more1 && pc_s->ser2 == pmi->more2 && pc_s->ser3 == pmi->more3 && pc_s->ser4 == pmi->more4)									advancementobjects(s, pmi->morex, 0);							}							else								advancementobjects(s, pmi->morex, 0);														if ((pmi->type == 81)&&(pc_s->isPlayer()))								if (pmi->more1 != 0 || pmi->more2 != 0 || pmi->more3 != 0 || pmi->more4 != 0)								{									if (pc_s->ser1 == pmi->more1 && pc_s->ser2 == pmi->more2 && pc_s->ser3 == pmi->more3 && pc_s->ser4 == pmi->more4)										advancementobjects(s, pmi->morex, 1);								}								else									advancementobjects(s, pmi->morex, 1);								// The above code lets you restrict a gate's use by setting its MORE values to a char's								// serial #																// damage objects								if (!(pc_s->isInvul()) && (pmi->type == 85))								{									pc_s->hp = pc_s->hp - (pmi->morex + RandomNum(pmi->morey, pmi->morez));									if (pc_s->hp < 1)										pc_s->hp = 0;									updatestats(s, 0);									if (pc_s->hp <= 0)										deathstuff(s);								}								// monster gates								if (pmi->type == 82)									monstergate(s, pmi->morex);								////////////////////////////////// 								// This will be just a body type switching 								// item. 								// 								// 								// 								if (pmi->type == 84) 									polycolorgate(s, pmi->morex); 								// 								// 								// Aldur 								//////////////////////////////////																// sound objects								if (pmi->type == 86)								{									if (RandomNum(1, 100) <= pmi->morez)										soundeffect3(pmi, (pmi->morex << 8) + pmi->morey);								}								if(pmi->type == 88)								{									Races.SetRace(pc_s,pmi->morex);								}					}				}			}		}	}}