Game Development Community

Minor problem in getControlObject?

by Cameron Tofer · in Torque Game Engine · 03/25/2005 (10:27 am) · 2 replies

This may not be too important and its also in the example game code, but, shouldn't this return -1 instead of 0 if there is no control object?

// gameConnection.cc : 1216
ConsoleMethod( GameConnection, getControlObject, S32, 2, 2, "")
{
argv;
SimObject* cp = object->getControlObject();
return cp? cp->getId(): 0;
}

#1
04/02/2005 (2:17 pm)
Either is OK, although -1 might be arguably better.
#2
04/02/2005 (2:17 pm)
Oh wait, -1 is the RootGroup. So 0 is actually better...