Hey Guys I changed my code, well, A LOT, and i'm not getting crashes anymore.

I've changed the way the camera turns with the player.
I was searching on some other post in other topics and I remove the tcam dummy entity and replace the while(key_cur) loop to this:

Code:
cam.x = actor.x - offset.x * cos(actor.pan);
cam.y = actor.y - offset.x * sin(actor.pan);
cam.pan = actor.pan;


Thanks for all the help anyway, especially EvilSOB! cool