ICameraSceneNode::deserializeAttributes

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
blueneptune
Posts: 1
Joined: Tue May 28, 2013 8:20 pm

ICameraSceneNode::deserializeAttributes

Post by blueneptune »

Code: Select all

 
void ICameraSceneNode::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)
{
  ISceneNode::deserializeAttributes(in, options);
    if (!in)
      return;
 
  if ( in->findAttribute("IsOrthogonal") )
    IsOrthogonal = in->getAttributeAsBool("IsOrthogonal");
}
 
...should be...

Code: Select all

 
void ICameraSceneNode::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)
{
  ISceneNode::deserializeAttributes(in, options);
    if (!in)
      return;
 
  if ( in->existsAttribute("IsOrthogonal") )
    IsOrthogonal = in->getAttributeAsBool("IsOrthogonal");
}
 
...since IAttributes::findAttribute returns -1 on failure, not 0 or false, as the original code seems to expect.

this doesn't cause problems, because the check is made redundant in the first place by CAttributes. but it should be correct.
Post Reply