Browse Source

Replaced returning empty strings with null

Mike Lilligreen 11 years ago
parent
commit
41c10da00f

+ 1 - 1
engine/source/2d/core/SpriteBase_ScriptBinding.h

@@ -153,7 +153,7 @@ ConsoleMethodWithDocs(SpriteBase, getImageFrameName, ConsoleString, 2, 2, ())
     {
         // No, so warn.
         Con::warnf( "SpriteBase::getImageFrameName() - Method invalid, not in static mode." );
-        return StringTable->EmptyString;
+        return NULL;
     }
     
     // Get image Frame.

+ 1 - 1
engine/source/2d/gui/SceneWindow_ScriptBinding.h

@@ -1412,7 +1412,7 @@ ConsoleMethodWithDocs(SceneWindow, getWorldPoint, ConsoleString, 3, 4, (X / Y))
    else
    {
       Con::warnf("SceneWindow::getWorldPoint() - Invalid number of parameters!");
-      return StringTable->EmptyString;
+      return NULL;
    }
    
    // Destination Point.

+ 15 - 15
engine/source/2d/sceneobject/SceneObject_ScriptBinding.h

@@ -739,8 +739,8 @@ ConsoleMethodWithDocs(SceneObject, getWorldPoint, ConsoleString, 3, 4, (float lo
    // Invalid
    else
    {
-      Con::warnf("SceneObject::getWorldPoint() - Invalid number of parameters!");
-       return StringTable->EmptyString;
+        Con::warnf("SceneObject::getWorldPoint() - Invalid number of parameters!");
+        return NULL;
    }
 
     // Calculate world coordinate.
@@ -812,7 +812,7 @@ ConsoleMethodWithDocs(SceneObject, getWorldVector, ConsoleString, 3, 4, (float l
    else
    {
       Con::warnf("SceneObject::getWorldVector() - Invalid number of parameters!");
-      return StringTable->EmptyString;
+      return NULL;
    }
 
     // Calculate world vector.
@@ -3059,14 +3059,14 @@ ConsoleMethodWithDocs( SceneObject, getChainCollisionShapeAdjacentStart, Console
     if ( shapeIndex >= shapeCount )
     {
         Con::warnf("SceneObject::getChainCollisionShapeAdjacentStart() - Invalid shape index of %d.", shapeIndex);
-        return StringTable->EmptyString;
+        return NULL;
     }
 
     // Sanity!
     if ( object->getCollisionShapeType( shapeIndex ) != b2Shape::e_chain )
     {
         Con::warnf("SceneObject::getChainCollisionShapeAdjacentStart() - Not a chain shape at index of %d.", shapeIndex);
-        return StringTable->EmptyString;
+        return NULL;
     }
 
     return object->getChainCollisionShapeAdjacentStart( shapeIndex ).scriptThis();
@@ -3090,14 +3090,14 @@ ConsoleMethodWithDocs( SceneObject, getChainCollisionShapeAdjacentEnd, ConsoleSt
     if ( shapeIndex >= shapeCount )
     {
         Con::warnf("SceneObject::getChainCollisionShapeAdjacentEnd() - Invalid shape index of %d.", shapeIndex);
-        return StringTable->EmptyString;
+        return NULL;
     }
 
     // Sanity!
     if ( object->getCollisionShapeType( shapeIndex ) != b2Shape::e_chain )
     {
         Con::warnf("SceneObject::getChainCollisionShapeAdjacentEnd() - Not a chain shape at index of %d.", shapeIndex);
-        return StringTable->EmptyString;
+        return NULL;
     }
 
     return object->getChainCollisionShapeAdjacentEnd( shapeIndex ).scriptThis();
@@ -3227,14 +3227,14 @@ ConsoleMethodWithDocs( SceneObject, getEdgeCollisionShapeLocalPositionStart, Con
     if ( shapeIndex >= shapeCount )
     {
         Con::warnf("SceneObject::getEdgeCollisionShapeLocalPositionStart() - Invalid shape index of %d.", shapeIndex);
-        return StringTable->EmptyString;
+        return NULL;
     }
 
     // Sanity!
     if ( object->getCollisionShapeType( shapeIndex ) != b2Shape::e_edge )
     {
         Con::warnf("SceneObject::getEdgeCollisionShapeLocalPositionStart() - Not an edge shape at index of %d.", shapeIndex);
-        return StringTable->EmptyString;
+        return NULL;
     }
 
     return object->getEdgeCollisionShapeLocalPositionStart( shapeIndex ).scriptThis();
@@ -3258,14 +3258,14 @@ ConsoleMethodWithDocs( SceneObject, getEdgeCollisionShapeLocalPositionEnd, Conso
     if ( shapeIndex >= shapeCount )
     {
         Con::warnf("SceneObject::getEdgeCollisionShapeLocalPositionEnd() - Invalid shape index of %d.", shapeIndex);
-        return StringTable->EmptyString;
+        return NULL;
     }
 
     // Sanity!
     if ( object->getCollisionShapeType( shapeIndex ) != b2Shape::e_edge )
     {
         Con::warnf("SceneObject::getEdgeCollisionShapeLocalPositionEnd() - Not an edge shape at index of %d.", shapeIndex);
-        return StringTable->EmptyString;
+        return NULL;
     }
 
     return object->getEdgeCollisionShapeLocalPositionEnd( shapeIndex ).scriptThis();
@@ -3351,14 +3351,14 @@ ConsoleMethodWithDocs( SceneObject, getEdgeCollisionShapeAdjacentStart, ConsoleS
     if ( shapeIndex >= shapeCount )
     {
         Con::warnf("SceneObject::getEdgeCollisionShapeAdjacentStart() - Invalid shape index of %d.", shapeIndex);
-        return StringTable->EmptyString;
+        return NULL;
     }
 
     // Sanity!
     if ( object->getCollisionShapeType( shapeIndex ) != b2Shape::e_edge )
     {
         Con::warnf("SceneObject::getEdgeCollisionShapeAdjacentStart() - Not an edge shape at index of %d.", shapeIndex);
-        return StringTable->EmptyString;
+        return NULL;
     }
 
     return object->getEdgeCollisionShapeAdjacentStart( shapeIndex ).scriptThis();
@@ -3382,14 +3382,14 @@ ConsoleMethodWithDocs( SceneObject, getEdgeCollisionShapeAdjacentEnd, ConsoleStr
     if ( shapeIndex >= shapeCount )
     {
         Con::warnf("SceneObject::getEdgeCollisionShapeAdjacentEnd() - Invalid shape index of %d.", shapeIndex);
-        return StringTable->EmptyString;
+        return NULL;
     }
 
     // Sanity!
     if ( object->getCollisionShapeType( shapeIndex ) != b2Shape::e_edge )
     {
         Con::warnf("SceneObject::getEdgeCollisionShapeAdjacentEnd() - Not an edge shape at index of %d.", shapeIndex);
-        return StringTable->EmptyString;
+        return NULL;
     }
 
     return object->getEdgeCollisionShapeAdjacentEnd( shapeIndex ).scriptThis();

+ 1 - 1
engine/source/collection/nameTags_ScriptBinding.h

@@ -275,7 +275,7 @@ ConsoleMethodWithDocs(NameTags, queryTags, ConsoleString, 3, 4, (tagIds, [exclud
     if ( tagId == 0 )
     {
         Con::warnf("Invalid tag Id.\n");
-        return StringTable->EmptyString;
+        return NULL;
     }
 
     // Query tags.

+ 1 - 1
engine/source/component/behaviors/behaviorComponent_ScriptBinding.h

@@ -340,7 +340,7 @@ ConsoleMethodWithDocs( BehaviorComponent, getBehaviorConnection, ConsoleString,
     {
         // No, so warn.
         Con::warnf("BehaviorComponent::getBehaviorConnections() - Could not find output behavior '%s'.", argv[2] );
-        return StringTable->EmptyString;
+        return NULL;
     }
 
     // Fetch output name.

+ 1 - 1
engine/source/module/moduleManager_ScriptBinding.h

@@ -288,7 +288,7 @@ ConsoleMethodWithDocs(ModuleManager, copyModule, ConsoleString, 6, 6, (sourceMod
     {
         // No, so warn.
         Con::warnf( "ModuleManager::copyModule() - Could not find source module definition '%s'.", argv[2] );
-        return StringTable->EmptyString;
+        return NULL;
     }
 
     // Fetch the target module Id.