Go Back   RunUO - Ultima Online Emulation > RunUO > Core Modifications > Subsystems

Subsystems This forum is for modifications to the various subystem code of RunUO

Reply
 
Thread Tools Display Modes
Old 01-28-2005, 07:12 PM   #1 (permalink)
 
Join Date: Nov 2004
Age: 44
Posts: 42
Default Fixing Range

Hello,

Well, here is the change I made to Utility.cs, since Geometry.cs already has Point3D defined, yet Utility.cs was not using it as defined:

Code:
public static bool InRange( Point3D p1, Point3D p2, int range )
		{
			return ( p1.m_X >= (p2.m_X - range) )
				&& ( p1.m_X <= (p2.m_X + range) )
				&& ( p1.m_Y >= (p2.m_Y - range) )
				&& ( p1.m_Y <= (p2.m_Y + range) )
				&& ( p1.m_Z >= (p2.m_Z - range) )
				&& ( p1.m_Z <= (p2.m_Z + range) );
		}

		public static bool InUpdateRange( Point3D p1, Point3D p2 )
		{
			return ( p1.m_X >= (p2.m_X - 18) )
				&& ( p1.m_X <= (p2.m_X + 18) )
				&& ( p1.m_Y >= (p2.m_Y - 18) )
				&& ( p1.m_Y <= (p2.m_Y + 18) )
				&& ( p1.m_Z >= (p2.m_Z - 18) )
				&& ( p1.m_Z <= (p2.m_Z + 18) );

I just added the Z component they already defined, so now you won't get someone on the third floor shooting or stealing from someone on the ground just because their X,Y is under range... now all three have to be.

A.V.
averisimilitude is offline   Reply With Quote
Old 01-28-2005, 08:26 PM   #2 (permalink)
Forum Administrator
 
krrios's Avatar
 
Join Date: Aug 2002
Posts: 2,850
Default

That is not the intended functionality of those methods; they are not intended to check the Z coordinate.

If you are having issues with stealing or attacking on multiple floors, you may be trying it on a staff (GM+) character, or there is some other line of sight issue.
krrios is offline   Reply With Quote
Old 01-28-2005, 09:42 PM   #3 (permalink)
 
Join Date: Nov 2004
Age: 44
Posts: 42
Default

Hello,

Ok, then I guess I do not follow how range checks between target and targetee are done then.

I know it uses the InRange and int range checks, and Point3D even Defines itself using a Z range, but how are these implemented to calculate range between two people if not the Utility and Geometry script functions. Point3D is the only place I have found InRange at all....

A.V.
averisimilitude is offline   Reply With Quote
Old 01-28-2005, 09:50 PM   #4 (permalink)
 
Join Date: Dec 2003
Posts: 1,069
Default

I believe that the client checks the Z values... I could be wrong.
__________________
HI!
jjarmis is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5