This topic contains 0 replies, has 0 voices, and was last updated by  imported_gcamp 13 years, 10 months ago.

  • Author
    Posts
  • #2407

    DeVice
    Participant

    My server tends to crash sometimes.
    Last time i did inspect the .core and found that the crash was caused by an attempt to access an un-initialised pointer or object.

    As far i can say this patch should fix it, but there’s probably a better solution for someone that know the code better than me.
    I’ll also try to keep the .core next time, i’ve been overenthusiast with the “rm” command today :]


    --- scorched-CVS/src/engine/PhysicsParticleObject.cpp Wed Nov 26 22:54:59 2003
    +++ scorched-work/src/engine/PhysicsParticleObject.cpp Thu Feb 5 09:23:59 2004
    @@ -67,10 +67,21 @@
    Vector &PhysicsParticleObject::getPosition()
    {
    static Vector position;
    - const dReal *pos = dBodyGetPosition(body_);
    - position[0] = (float) pos[0];
    - position[1] = (float) pos[1];
    - position[2] = (float) pos[2];
    +
    + if (body_)
    + {
    + const dReal *pos = dBodyGetPosition(body_);
    + position[0] = (float) pos[0];
    + position[1] = (float) pos[1];
    + position[2] = (float) pos[2];
    + }
    + else
    + {
    + position[0] = 0.0;
    + position[1] = 0.0;
    + position[2] = 0.0;
    + }
    +
    return position;
    }

    #10639

    imported_gcamp
    Participant

    Thanks, Ive added it (or something similar).

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.