Game Development Community

Editor Bug Fix Selecting self in 3rd person

by William Kosche · in Torque Game Engine · 10/23/2004 (12:11 pm) · 1 replies

In running some debug marathons i found a bug that crashes the engine.

The bug occurs when pulling down the editor in 3rd person and then selecting a box via dragging on your "self". In my case it was a car.

The error was caused from these few lines in GuiInspector.cc
In void GuiInspector::inspect(SimObject * obj)
at roughly line 279
if (groupExpand)
      {
         // Yes, so add controls.

         for(U32 i = 0; i < itr->elementCount; i++)
         {
            const char * dstr = Con::getData(itr->type, (void *)(((const char *)obj) + itr->offset), i, itr->table, itr->flag);
            if(!dstr)
               dstr = "";<--- offending bug maker -- line 279
            expandEscape(textbuf, dstr);

Heres the fix

const char * dstr = Con::getData(itr->type, (void *)(((const char *)obj) + itr->offset), i, itr->table, itr->flag);
            if(!dstr)
               dstr = "[[60c23271a8811]]"; 
            expandEscape(textbuf, dstr);

if dstr was left as "" the expandEscape function continues past its buffer limit , thus crashing the game.

#1
10/25/2004 (11:19 pm)
Bump this up, I hope this gets patched into CVS as soon as possible. It's bug fixes like this that really do matter. :)