From 3a995415414c1d07ea7e894aac27838a7e194b7b Mon Sep 17 00:00:00 2001 From: Areloch Date: Mon, 9 May 2016 13:43:06 -0500 Subject: [PATCH 1/3] Select camera when in material editor crashfix. When attempting to select a camera Object(so going into the editor, going into the freefloating camera and then back to the player camera and selecting the freefloating one) while the material editor was open, it would crash because it attempts to access the shapebase object's shapeInstance - but cameras don't have a shape. This fixes it so it makes sure there's a shapeinstance before trying to get the material data. --- Engine/source/T3D/shapeBase.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Engine/source/T3D/shapeBase.cpp b/Engine/source/T3D/shapeBase.cpp index 52ea070e3..e8e067465 100644 --- a/Engine/source/T3D/shapeBase.cpp +++ b/Engine/source/T3D/shapeBase.cpp @@ -4888,7 +4888,8 @@ DefineEngineMethod( ShapeBase, getTargetCount, S32, (),, if ((ShapeBase*)obj->getClientObject()) obj = (ShapeBase*)obj->getClientObject(); - return obj->getShapeInstance()->getTargetCount(); + if (obj->getShapeInstance() != NULL) + return obj->getShapeInstance()->getTargetCount(); } return -1; From 27bb7a712a57c3769e9d3a395e2096908dd30349 Mon Sep 17 00:00:00 2001 From: Areloch Date: Mon, 9 May 2016 13:47:29 -0500 Subject: [PATCH 2/3] Corrects tabs. --- Engine/source/T3D/shapeBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Engine/source/T3D/shapeBase.cpp b/Engine/source/T3D/shapeBase.cpp index e8e067465..c33cb7f73 100644 --- a/Engine/source/T3D/shapeBase.cpp +++ b/Engine/source/T3D/shapeBase.cpp @@ -4889,7 +4889,7 @@ DefineEngineMethod( ShapeBase, getTargetCount, S32, (),, obj = (ShapeBase*)obj->getClientObject(); if (obj->getShapeInstance() != NULL) - return obj->getShapeInstance()->getTargetCount(); + return obj->getShapeInstance()->getTargetCount(); } return -1; From 8d195f923693dd6012cd388b7250354f81d89c00 Mon Sep 17 00:00:00 2001 From: Areloch Date: Tue, 10 May 2016 10:58:03 -0500 Subject: [PATCH 3/3] Makes the tab/spaces consistent for the entire console method function rather than mix-n-matching the formatting. --- Engine/source/T3D/shapeBase.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Engine/source/T3D/shapeBase.cpp b/Engine/source/T3D/shapeBase.cpp index c33cb7f73..6f40cc134 100644 --- a/Engine/source/T3D/shapeBase.cpp +++ b/Engine/source/T3D/shapeBase.cpp @@ -4881,18 +4881,18 @@ DefineEngineMethod( ShapeBase, getTargetCount, S32, (),, "@see getTargetName()\n") { - ShapeBase *obj = dynamic_cast< ShapeBase* > ( object ); - if(obj) - { - // Try to use the client object (so we get the reskinned targets in the Material Editor) - if ((ShapeBase*)obj->getClientObject()) - obj = (ShapeBase*)obj->getClientObject(); + ShapeBase *obj = dynamic_cast< ShapeBase* > ( object ); + if(obj) + { + // Try to use the client object (so we get the reskinned targets in the Material Editor) + if ((ShapeBase*)obj->getClientObject()) + obj = (ShapeBase*)obj->getClientObject(); if (obj->getShapeInstance() != NULL) return obj->getShapeInstance()->getTargetCount(); } - - return -1; + + return -1; } DefineEngineMethod( ShapeBase, changeMaterial, void, ( const char* mapTo, Material* oldMat, Material* newMat ),,