mirror of
https://github.com/glest/glest-source.git
synced 2025-02-24 03:32:35 +01:00
Additional warning for modders to find problems with mesh bound particles.
This commit is contained in:
parent
2cb45f876f
commit
aee2417ce1
@ -1162,6 +1162,7 @@ void UnitParticleSystem::initParticle(Particle *p, int particleIndex){
|
|||||||
Vec3f combinedOffset=Vec3f(offset);
|
Vec3f combinedOffset=Vec3f(offset);
|
||||||
if(meshName!="" && unitModel!=NULL){
|
if(meshName!="" && unitModel!=NULL){
|
||||||
//printf("meshName set unitModel given\n");
|
//printf("meshName set unitModel given\n");
|
||||||
|
bool foundMesh=false;
|
||||||
for(uint i=0; i<unitModel->getMeshCount() ; i++){
|
for(uint i=0; i<unitModel->getMeshCount() ; i++){
|
||||||
//printf("meshName=%s\n",unitModel->getMesh(i)->getName().c_str());
|
//printf("meshName=%s\n",unitModel->getMesh(i)->getName().c_str());
|
||||||
if(unitModel->getMesh(i)->getName()==meshName){
|
if(unitModel->getMesh(i)->getName()==meshName){
|
||||||
@ -1171,8 +1172,20 @@ void UnitParticleSystem::initParticle(Particle *p, int particleIndex){
|
|||||||
combinedOffset.x+=verticepos->x;
|
combinedOffset.x+=verticepos->x;
|
||||||
combinedOffset.y+=verticepos->y;
|
combinedOffset.y+=verticepos->y;
|
||||||
combinedOffset.z+=verticepos->z;
|
combinedOffset.z+=verticepos->z;
|
||||||
|
foundMesh==true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if( foundMesh == false ) {
|
||||||
|
string meshesFound="";
|
||||||
|
for(uint i=0; i<unitModel->getMeshCount() ; i++){
|
||||||
|
meshesFound+= unitModel->getMesh(i)->getName()+", ";
|
||||||
|
}
|
||||||
|
|
||||||
|
string errorString = "Warning: Particle system is trying to find mesh'"+meshName+"', but just found:\n'"+meshesFound+"' in file:\n'"+unitModel->getFileName()+"'\n";
|
||||||
|
//throw megaglest_runtime_error(errorString);
|
||||||
|
printf("%s",errorString.c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_STREFLOP
|
#ifdef USE_STREFLOP
|
||||||
|
Loading…
x
Reference in New Issue
Block a user