浏览代码

Modified callback to ensure that when a shapeAsset changes, groundCovers properly re-initialize to reflect the change

JeffR 5 月之前
父节点
当前提交
24db0305f6
共有 2 个文件被更改,包括 9 次插入2 次删除
  1. 4 1
      Engine/source/T3D/fx/groundCover.cpp
  2. 5 1
      Engine/source/T3D/fx/groundCover.h

+ 4 - 1
Engine/source/T3D/fx/groundCover.cpp

@@ -852,8 +852,11 @@ void GroundCover::unpackUpdate( NetConnection *connection, BitStream *stream )
       // It's sloppy, but it works for now.
       // It's sloppy, but it works for now.
       _freeCells();
       _freeCells();
 
 
-      if ( isProperlyAdded() )
+      if (isProperlyAdded())
+      {
          _initMaterial();
          _initMaterial();
+         _initShapes();
+      }
    }
    }
 }
 }
 
 

+ 5 - 1
Engine/source/T3D/fx/groundCover.h

@@ -410,7 +410,11 @@ protected:
 
 
    void _debugRender( ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance *overrideMat );
    void _debugRender( ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance *overrideMat );
 
 
-   void onShapeChanged(){}
+   void onShapeChanged()
+   {
+      _initShapes();
+      setMaskBits(U32(-1));
+   }
 };
 };
 
 
 #endif // _GROUNDCOVER_H_
 #endif // _GROUNDCOVER_H_