From: Andrew C. <ac...@us...> - 2005-10-23 20:54:59
|
Update of /cvsroot/planeshift/planeshift/src/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16856/src/server Modified Files: gem.cpp gem.h psproxlist.cpp psproxlist.h workmanager.cpp Log Message: Added ability to ignore Y value on range check. Index: gem.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/gem.cpp,v retrieving revision 1.266 retrieving revision 1.267 diff -C2 -d -r1.266 -r1.267 *** gem.cpp 23 Oct 2005 12:57:25 -0000 1.266 --- gem.cpp 23 Oct 2005 20:54:49 -0000 1.267 *************** *** 716,722 **** ! float gemObject::RangeTo(gemObject* obj) { ! return proxlist->RangeTo(obj ); } --- 716,722 ---- ! float gemObject::RangeTo(gemObject* obj, bool ignoreY) { ! return proxlist->RangeTo(obj, ignoreY); } Index: gem.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/gem.h,v retrieving revision 1.127 retrieving revision 1.128 diff -C2 -d -r1.127 -r1.128 *** gem.h 23 Oct 2005 12:57:25 -0000 1.127 --- gem.h 23 Oct 2005 20:54:50 -0000 1.128 *************** *** 269,273 **** int GetClientID(); Client * GetClient(); ! float RangeTo(gemObject *obj); virtual bool IsUpdateReq (csVector3 const &pos,csVector3 const &oldPos) { --- 269,273 ---- int GetClientID(); Client * GetClient(); ! float RangeTo(gemObject *obj, bool ignoreY = false); virtual bool IsUpdateReq (csVector3 const &pos,csVector3 const &oldPos) { Index: psproxlist.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/psproxlist.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** psproxlist.cpp 1 Sep 2005 21:11:33 -0000 1.30 --- psproxlist.cpp 23 Oct 2005 20:54:50 -0000 1.31 *************** *** 418,422 **** ! float ProximityList::RangeTo( gemObject* object ) { #ifdef PSPROXDEBUG --- 418,422 ---- ! float ProximityList::RangeTo( gemObject* object, bool ignoreY ) { #ifdef PSPROXDEBUG *************** *** 442,448 **** float penalty = (sector1==sector2) ? 0 : 50; ! return ( sqrt( (pos1.x - pos2.x)*(pos1.x - pos2.x)+ (pos1.y - pos2.y)*(pos1.y - pos2.y)+ (pos1.z - pos2.z)*(pos1.z - pos2.z)) + penalty ); } --- 442,456 ---- float penalty = (sector1==sector2) ? 0 : 50; ! if ( ignoreY ) ! { ! return ( sqrt( (pos1.x - pos2.x)*(pos1.x - pos2.x)+ ! (pos1.z - pos2.z)*(pos1.z - pos2.z)) + penalty ); ! } ! else ! { ! return ( sqrt( (pos1.x - pos2.x)*(pos1.x - pos2.x)+ (pos1.y - pos2.y)*(pos1.y - pos2.y)+ (pos1.z - pos2.z)*(pos1.z - pos2.z)) + penalty ); + } } Index: psproxlist.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/psproxlist.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** psproxlist.h 17 Jun 2005 14:10:00 -0000 1.14 --- psproxlist.h 23 Oct 2005 20:54:50 -0000 1.15 *************** *** 113,117 **** bool CheckUpdateFrequency(); ! float RangeTo( gemObject* object ); void DebugDumpContents(csStringBase& out); --- 113,117 ---- bool CheckUpdateFrequency(); ! float RangeTo( gemObject* object, bool ignoreY = false ); void DebugDumpContents(csStringBase& out); Index: workmanager.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/workmanager.cpp,v retrieving revision 1.123 retrieving revision 1.124 diff -C2 -d -r1.123 -r1.124 *** workmanager.cpp 23 Oct 2005 00:07:34 -0000 1.123 --- workmanager.cpp 23 Oct 2005 20:54:50 -0000 1.124 *************** *** 1217,1221 **** // Check use range ! if (worker->gemobj->RangeTo(target) > RANGE_TO_USE) { //psserver->SendSystemInfo(clientNum,"You are not in range to use %s.",target->GetItem()->GetName()); --- 1217,1221 ---- // Check use range ! if (worker->gemobj->RangeTo(target, true) > RANGE_TO_USE) { //psserver->SendSystemInfo(clientNum,"You are not in range to use %s.",target->GetItem()->GetName()); |