aboutsummaryrefslogtreecommitdiff
path: root/src/server/collision/Models/ModelInstance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/collision/Models/ModelInstance.cpp')
-rw-r--r--src/server/collision/Models/ModelInstance.cpp30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/server/collision/Models/ModelInstance.cpp b/src/server/collision/Models/ModelInstance.cpp
index 677a08e147a..1ab6b363b22 100644
--- a/src/server/collision/Models/ModelInstance.cpp
+++ b/src/server/collision/Models/ModelInstance.cpp
@@ -1,24 +1,25 @@
/*
+ * Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ModelInstance.h"
#include "WorldModel.h"
#include "MapTree.h"
+#include "VMapDefinitions.h"
using G3D::Vector3;
using G3D::Ray;
@@ -56,8 +57,11 @@ namespace VMAP
Ray modRay(p, iInvRot * pRay.direction());
float distance = pMaxDist * iInvScale;
bool hit = iModel->IntersectRay(modRay, distance, pStopAtFirstHit);
- distance *= iScale;
- pMaxDist = distance;
+ if(hit)
+ {
+ distance *= iScale;
+ pMaxDist = distance;
+ }
return hit;
}