*Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)

*Fix a possible crash in Spell::DoAllEffectOnTarget

--HG--
branch : trunk
This commit is contained in:
maximius
2009-10-17 15:35:07 -07:00
parent f21f47005d
commit 26b5e033ff
2257 changed files with 750 additions and 103852 deletions
-10
View File
@@ -17,13 +17,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef TRINITYCORE_PATH_H
#define TRINITYCORE_PATH_H
#include "Common.h"
#include <vector>
class Path
{
public:
@@ -31,12 +28,10 @@ class Path
{
float x,y,z;
};
void SetLength(const unsigned int sz)
{
i_nodes.resize( sz );
}
unsigned int Size() const { return i_nodes.size(); }
bool Empty() const { return i_nodes.empty(); }
void Resize(unsigned int sz) { i_nodes.resize(sz); }
@@ -55,7 +50,6 @@ class Path
}
return len;
}
float GetPassedLength(uint32 curnode, float x, float y, float z)
{
float len = 0, xd, yd, zd;
@@ -66,7 +60,6 @@ class Path
zd = i_nodes[ idx ].z - i_nodes[ idx-1 ].z;
len += sqrtf( xd*xd + yd*yd + zd*zd );
}
if(curnode > 0)
{
xd = x - i_nodes[curnode-1].x;
@@ -74,13 +67,10 @@ class Path
zd = z - i_nodes[curnode-1].z;
len += sqrtf( xd*xd + yd*yd + zd*zd );
}
return len;
}
PathNode& operator[](const unsigned int idx) { return i_nodes[idx]; }
const PathNode& operator()(const unsigned int idx) const { return i_nodes[idx]; }
protected:
std::vector<PathNode> i_nodes;
};