aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2015-01-31 22:57:08 +0100
committerNayd <dnpd.dd@gmail.com>2015-01-31 22:21:53 +0000
commit7870ca8fdc030d102e91ac15756e3d22332676b0 (patch)
treeeaa99b32a49d2eaf364c29e555abd8fcd88c2cb4 /src
parenta46d2017230f10348a138af49aec784d28fde391 (diff)
Core/VMaps: Fix debug assert caused by invalid vmaps
Fix debug assert thrown by G3D caused by models with empty bounding box being exported by vmap4assembler and imported by worldserver. This change will skip those models, proper investigation on the issue of why the bounding box is empty is still required. (cherry picked from commit a7ca78b2fe12c68e561782416bf5726410a3c01b)
Diffstat (limited to 'src')
-rw-r--r--src/server/collision/Maps/TileAssembler.cpp12
-rw-r--r--src/server/collision/Models/GameObjectModel.cpp6
2 files changed, 18 insertions, 0 deletions
diff --git a/src/server/collision/Maps/TileAssembler.cpp b/src/server/collision/Maps/TileAssembler.cpp
index 06540ecdc61..ee978211577 100644
--- a/src/server/collision/Maps/TileAssembler.cpp
+++ b/src/server/collision/Maps/TileAssembler.cpp
@@ -391,6 +391,18 @@ namespace VMAP
}
}
+ if (bounds.isEmpty())
+ {
+ std::cout << "\nModel " << std::string(buff, name_length) << " has empty bounding box" << std::endl;
+ continue;
+ }
+
+ if (!bounds.isFinite())
+ {
+ std::cout << "\nModel " << std::string(buff, name_length) << " has invalid bounding box" << std::endl;
+ continue;
+ }
+
fwrite(&displayId, sizeof(uint32), 1, model_list_copy);
fwrite(&name_length, sizeof(uint32), 1, model_list_copy);
fwrite(&buff, sizeof(char), name_length, model_list_copy);
diff --git a/src/server/collision/Models/GameObjectModel.cpp b/src/server/collision/Models/GameObjectModel.cpp
index 993c298941c..05bd5d360c6 100644
--- a/src/server/collision/Models/GameObjectModel.cpp
+++ b/src/server/collision/Models/GameObjectModel.cpp
@@ -78,6 +78,12 @@ void LoadGameObjectModelList()
break;
}
+ if (v1.isNaN() || v2.isNaN())
+ {
+ VMAP_ERROR_LOG("misc", "File '%s' Model '%s' has invalid v1%s v2%s values!", VMAP::GAMEOBJECT_MODELS, std::string(buff, name_length).c_str(), v1.toString().c_str(), v2.toString().c_str());
+ continue;
+ }
+
model_list.insert
(
ModelList::value_type( displayId, GameobjectModelData(std::string(buff, name_length), AABox(v1, v2)) )