From: Xordan <mg...@us...> - 2007-10-17 23:30:17
|
Update of /cvsroot/planeshift/planeshift/src/server/bulkobjects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3124/server/bulkobjects Modified Files: pscharacter.cpp psspell.cpp Log Message: - Did some code nicefying and maybe fixed some possible accuracy problems. Made a printf more useful too. Index: pscharacter.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/bulkobjects/pscharacter.cpp,v retrieving revision 1.528 retrieving revision 1.529 diff -C2 -d -r1.528 -r1.529 *** pscharacter.cpp 14 Oct 2007 11:37:16 -0000 1.528 --- pscharacter.cpp 17 Oct 2007 23:30:19 -0000 1.529 *************** *** 1277,1283 **** { // No position specified or it was invalid. ! suggestedPos.x = location.loc_x - (DROP_DISTANCE * sin(location.loc_yrot)); suggestedPos.y = location.loc_y; ! suggestedPos.z = location.loc_z - (DROP_DISTANCE * cos(location.loc_yrot)); } --- 1277,1283 ---- { // No position specified or it was invalid. ! suggestedPos.x = location.loc_x - (DROP_DISTANCE * sinf(location.loc_yrot)); suggestedPos.y = location.loc_y; ! suggestedPos.z = location.loc_z - (DROP_DISTANCE * cosf(location.loc_yrot)); } Index: psspell.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/bulkobjects/psspell.cpp,v retrieving revision 1.124 retrieving revision 1.125 diff -C2 -d -r1.124 -r1.125 *** psspell.cpp 29 Sep 2007 23:09:08 -0000 1.124 --- psspell.cpp 17 Oct 2007 23:30:19 -0000 1.125 *************** *** 460,469 **** float cosATAngle = TP*ATP / (TP.Norm()*ATP.Norm()); if(cosATAngle > 1) ! cosATAngle = 1; if(cosATAngle < -1) ! cosATAngle = -1; ! CPrintf(CON_DEBUG, "Target %s is %1.2f radians from LOS at a range of %1.2fm.\n", affectedTarget->GetName(), acos(cosATAngle), caster->RangeTo(affectedTarget)); ! if ( acos(cosATAngle) < affectRadians ) CPrintf(CON_DEBUG, "Target %s is in affected area and is in range.\n", affectedTarget->GetName()); else continue; --- 460,469 ---- float cosATAngle = TP*ATP / (TP.Norm()*ATP.Norm()); if(cosATAngle > 1) ! cosATAngle = 1.0f; if(cosATAngle < -1) ! cosATAngle = -1.0f; ! CPrintf(CON_DEBUG, "Target %s is %1.2f radians from LOS at a range of %1.2fm, with a cosATAngle of %1.2f.\n", affectedTarget->GetName(), acosf(cosATAngle), caster->RangeTo(affectedTarget), cosATAngle); ! if ( acosf(cosATAngle) < affectRadians ) CPrintf(CON_DEBUG, "Target %s is in affected area and is in range.\n", affectedTarget->GetName()); else continue; |