AggrorJorn Posted June 2, 2013 Share Posted June 2, 2013 From time to time my game crashes when a collision hook is triggered. It is difficult to see where it goes exactly wrong. I can send you the project if you like. I always get the following call stack error: Link to comment Share on other sites More sharing options...
Josh Posted June 2, 2013 Share Posted June 2, 2013 I can debug it if you send the project. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
AggrorJorn Posted June 2, 2013 Author Share Posted June 2, 2013 I send you a pm with the source code. Link to comment Share on other sites More sharing options...
AggrorJorn Posted June 5, 2013 Author Share Posted June 5, 2013 I noticed that the stack call has changed slightly. It still happens at the same time: Link to comment Share on other sites More sharing options...
Josh Posted June 21, 2013 Share Posted June 21, 2013 Not a good idea. I have hundreds of messages. Please post it here if you can. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
AggrorJorn Posted June 25, 2013 Author Share Posted June 25, 2013 I really would like to see this solved, so I will just put the source code here although I would have prefer it if we could have some sort of secure environment for this. http://www.leadwerks.com/werkspace/index.php?app=core&module=attach§ion=attach&attach_id=4856 Link to comment Share on other sites More sharing options...
Josh Posted June 25, 2013 Share Posted June 25, 2013 testing now... My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted June 25, 2013 Share Posted June 25, 2013 Is this using a callback or script to change the map inside the collision hook? This would definitely produce a crash. For stuff like this, it's best to set a global variable and then handle that in your main loop. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted June 25, 2013 Share Posted June 25, 2013 Check out some of the posts below this to get more detail Aggror: http://www.leadwerks.com/werkspace/files/file/430-next-level/ I don't agree with the global idea but the idea Josh is trying to say is that you can't change levels when inside the engines World::Update() method, which is the case inside a callback since World::Update() is actually calling that callback. You can set some flags and such inside this, and then change it at the start of your game loop. Again, I would avoid globals personally as there is for sure a better way to handle map switching but to each their own. Link to comment Share on other sites More sharing options...
AggrorJorn Posted June 25, 2013 Author Share Posted June 25, 2013 The hook only sets a global bool to true. The level loading itself is done within a class. I am not using any lua to load levels. After replacing the collision hook (which triggered a next level loading outside the hook) with a simple distance checker, I still get this error. So right now I don't have any collision hooks. Link to comment Share on other sites More sharing options...
Josh Posted June 25, 2013 Share Posted June 25, 2013 I found the cause of this. Old bodies that were scheduled for deletion were hanging around causing errors. This was a mistake in my threading implementation. 2 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts