2
0
Эх сурвалжийг харах

Corrects preload logic for projectiles to only fail if shape is specified, but failed to load
Corrects logic in Project Importer for if cubemapData is defined in material scripts, it can process them correctly.

Areloch 4 жил өмнө
parent
commit
0dddeeb6dd

+ 14 - 10
Engine/source/T3D/projectile.cpp

@@ -377,18 +377,22 @@ bool ProjectileData::preload(bool server, String &errorStr)
             Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet, bad datablockid(lightDesc): %d", lightDescId);   
    }
 
-   if (!mProjectileShape)
+   if (mProjectileShapeAssetId != StringTable->EmptyString())
    {
-      errorStr = String::ToString("ProjectileData::load: Couldn't load shape \"%s\"", mProjectileShapeAssetId);
-      return false;
-   }
-   else
-   {
-      activateSeq = mProjectileShape->findSequence("activate");
-      maintainSeq = mProjectileShape->findSequence("maintain");
+      //If we've got a shapeAsset assigned for our projectile, but we failed to load the shape data itself, report the error
+      if (!mProjectileShape)
+      {
+         errorStr = String::ToString("ProjectileData::load: Couldn't load shape \"%s\"", mProjectileShapeAssetId);
+         return false;
+      }
+      else
+      {
+         activateSeq = mProjectileShape->findSequence("activate");
+         maintainSeq = mProjectileShape->findSequence("maintain");
 
-      TSShapeInstance* pDummy = new TSShapeInstance(mProjectileShape, !server);
-      delete pDummy;
+         TSShapeInstance* pDummy = new TSShapeInstance(mProjectileShape, !server);
+         delete pDummy;
+      }
    }
 
    return true;

+ 2 - 2
Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript

@@ -218,7 +218,7 @@ function T3Dpre4ProjectImporter::beginMaterialFilesImport(%this)
             {
                %className = findObjectClass(%line, "new");
 
-               if(%className !$= "Material" && %className !$= "CustomMaterial" && %className !$= "TerrainMaterial")
+               if(%className !$= "Material" && %className !$= "CustomMaterial" && %className !$= "TerrainMaterial" && %className !$= "CubemapData")
                   {
                      %lineNum++;
                      %fileOutputLines.push_back(%line);
@@ -267,7 +267,7 @@ function T3Dpre4ProjectImporter::beginMaterialFilesImport(%this)
             {
                %className = findObjectClass(%line, "singleton");
                
-               if(%className !$= "Material" && %className !$= "CustomMaterial" && %className !$= "TerrainMaterial")
+               if(%className !$= "Material" && %className !$= "CustomMaterial" && %className !$= "TerrainMaterial" && %className !$= "CubemapData")
                   {
                      %lineNum++;
                      %fileOutputLines.push_back(%line);