if (npcinrange(s, pc_mount, 2) == 0 && !pc_currchar->isGM())
if( pc_currchar->inRange( pc_mount, 2 ) && !pc_currchar->isGM() )
void mounthorse(UOXSOCKET s, P_CHAR pc_mount) // Remove horse char and give player a horse item{	int j;	if ( pc_mount == NULL ) return;	P_CHAR pc_currchar = currchar[s];		if (npcinrange(s, pc_mount, 2) == 0 && !pc_currchar->isGM())		return;	if (pc_currchar->Owns(pc_mount) || pc_currchar->isGM())	{		if (pc_currchar->onHorse())		{			sysmessage(s, "You are already on a mount.");			return;		}		strcpy((char*)temp, pc_mount->name.c_str());		pc_currchar->setOnHorse( true );		const P_ITEM pi = Items->SpawnItem(pc_currchar, 1, (char*)temp, 0, 0x0915, pc_mount->skin(), 0);		if(!pi) return;				switch (static_cast<ushort>(pc_mount->id()&0x00FF))		{			case 0xC8: pi->setId(0x3E9F); break; // Horse			case 0xE2: pi->setId(0x3EA0); break; // Horse			case 0xE4: pi->setId(0x3EA1); break; // Horse			case 0xCC: pi->setId(0x3EA2); break; // Horse			case 0xD2: pi->setId(0x3EA3); break; // Desert Ostard			case 0xDA: pi->setId(0x3EA4); break; // Frenzied Ostard			case 0xDB: pi->setId(0x3EA5); break; // Forest Ostard			case 0xDC: pi->setId(0x3EA6); break; // LLama			case 0x34: pi->setId(0x3E9F); break; // Brown Horse			case 0x4E: pi->setId(0x3EA0); break; // Grey Horse			case 0x50: pi->setId(0x3EA1); break; // Tan Horse			case 0x74: pi->setId(0x3EB5); break; // Nightmare			case 0x75: pi->setId(0x3EA8); break; // Silver Steed			case 0x72: pi->setId(0x3EA9); break; // Dark Steed			case 0x7A: pi->setId(0x3EB4); break; // Unicorn			case 0x84: pi->setId(0x3EAD); break; // Kirin			case 0x73: pi->setId(0x3EAA); break; // Etheral			case 0x76: pi->setId(0x3EB2); break; // War Horse-Brit			case 0x77: pi->setId(0x3EB1); break; // War Horse-Mage Council			case 0x78: pi->setId(0x3EAF); break; // War Horse-Minax			case 0x79: pi->setId(0x3EB0); break; // War Horse-Shadowlord			case 0xAA: pi->setId(0x3EAB); break; // Etheral LLama			case 0x3A: pi->setId(0x3EA4); break; // Forest Ostard			case 0x39: pi->setId(0x3EA3); break; // Desert Ostard			case 0x3B: pi->setId(0x3EA5); break; // Frenzied Ostard			case 0x90: pi->setId(0x3EB3); break; // Seahorse			case 0xAB: pi->setId(0x3EAC); break; // Etheral Ostard			case 0xBB: pi->setId(0x3EB8); break; // Ridgeback			case 0x17: pi->setId(0x3EBC); break; // giant beetle			case 0x19: pi->setId(0x3EBB); break; // skeletal mount			case 0x1a: pi->setId(0x3EBD); break;// swamp dragon			case 0x1f: pi->setId(0x3EBE); break;// armor dragon		}				pi->setContSerial(pc_currchar->serial);		pi->setLayer( 0x19 );		Coord_cl pos(pc_currchar->pos);		pos.x = pc_mount->fx1;		pos.y = pc_mount->fy1;		pos.z = pc_mount->fz1;		pi->moveTo(pos);				pi->setMoreb1( pc_mount->npcWander );		pi->att = pc_mount->fx2;		pi->def = pc_mount->fy2;				// AntiChrist bugfixes - 11/10/99		pi->setMoreb2( pc_mount->st );		pi->setMoreb3( pc_mount->realDex() );		pi->setMoreb4( pc_mount->in );		pi->setHp( pc_mount->hp );		pi->setLodamage( pc_mount->fame );		pi->setHidamage( pc_mount->karma );		pi->poisoned = pc_mount->poisoned();		if (pc_mount->summontimer != 0)			pi->decaytime = pc_mount->summontimer;				wornitems(s, pc_currchar);// send update to current socket				for (j = 0; j < now; j++)// and to all inrange sockets (without re-sending to current socket)		{			if (inrange1(s, j) && perm[j] &&(s != j))				wornitems(j, pc_currchar);		}		//////////////////////////////////		// Gonna stable instead of delete a mount.		// This will keep their original and earned		// stats and will allow more roboust		// mount code.		//		//		//		// Gonna stable instead of delete so		// comment this out		// Npcs->DeleteChar(x);		int stablemaster_serial = pc_currchar->serial;				// if this is a gm lets tame the animal in the process		if (pc_currchar->isGM())		{			pc_mount->SetOwnSerial( pc_currchar->serial );			pc_mount->setNpcAIType( 0 );		}				// set stablesp && pets stablemaster serial		// remove it from screen!		int xx = pc_mount->pos.x;		int yy = pc_mount->pos.y;		signed char zz = pc_mount->pos.z;		unsigned short id = pc_mount->id();		pc_mount->setId(0);		pc_mount->pos = Coord_cl(0, 0, 0);				for (int ch = 0; ch < now; ch++)		{			if (perm[ch])				impowncreate(ch, pc_mount, 0);		}				pc_mount->setId(id);		pc_mount->war = false;		pc_mount->attacker = INVALID_SERIAL;		pc_mount->pos = Coord_cl(xx, yy, zz);				mapRegions->Remove(pc_mount);				pc_mount->setStablemaster_serial( stablemaster_serial );				// set timer		pc_mount->setTime_unused( 0 );		pc_mount->setTimeused_last( getNormalizedTime() );				stablesp.insert(stablemaster_serial, pc_mount->serial);		//		//		// Aldur		//////////////////////////////////	}	else		sysmessage(s, "You dont own that creature.");}