RandyGaul / qu3e

Lightweight and Simple 3D Open Source Physics Engine in C++
zlib License
920 stars 110 forks source link

Potential bug in q3Body::RemoveBox #14

Closed Kazade closed 7 years ago

Kazade commented 8 years ago

My compiler gives me an unused variable warning (list) at this section of code:

    q3Box* node = m_boxes;
    q3Box* list = m_boxes;

    bool found = false;
    if ( node == box )
    {
        list = node->next;
        found = true;
    }

Indeed, the list variable is assigned to, but never used. It seems to me that in this particular case (where the head of the m_boxes list is the box to be removed) m_boxes isn't updated to point to node->next. I'm not convinced I've fully groked the code yet though, I just saw this in passing.

RandyGaul commented 8 years ago

Will check out pull request at some point and make sure there's no bug :)

RandyGaul commented 7 years ago

All seems well. Good catch!