Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


I can compile it, but it crashes...
Urkle Offline
FG - Associate

Posts: 1,172
Threads: 31
Joined: Jul 2006
Reputation: 21
#13
RE: I can compile it, but it crashes...

actually. what I meant by "break" was a breakpoint for debugging, not a break statement :-D

another option would be to rewrite the function like this..
void iPhysicsWorld::DestroyBody(iPhysicsBody* apBody)
{
    //STLFindAndDelete(mlstBodies, apBody);
    tPhysicsBodyListIt it = mlstBodies.begin();
    for(; it != mlstBodies.end();)
    {
        iPhysicsBody *pBody = *it;
        if(pBody == apBody)
        {
            if(mpWorld3D) mpWorld3D->GetPortalContainer()->RemoveEntity(pBody);
            pBody->Destroy();
            hplDelete(pBody);
            it = mlstBodies.erase(it);
        } else {
            ++it;
        }
    }
}

As for your other crash. Just stick a breakpoint (usually by clicking off on the left margin of the source editor) and run the game from VS, and step through to figure out where the NULL value is coming from.

Developing away on one of
Multiple Macs running 10.6, 10.7, 10.8, and 10.9.
Linux, 8-core AMD, 8GB RAM, Fedora 18, nVidia 450 1GB
05-17-2010, 02:20 PM
Website Find


Messages In This Thread
RE: I can compile it, but it crashes... - by Urkle - 05-17-2010, 02:20 PM



Users browsing this thread: 3 Guest(s)