I might have found the problem. I used m_OwnerName == "" instead of m_OwnerName != ""
It works
Aww I get deadlocks when logging out ;(
It works
Aww I get deadlocks when logging out ;(
Random Chitchat 2012-2016
|
||||
I might have found the problem. I used m_OwnerName == "" instead of m_OwnerName != ""
It works Aww I get deadlocks when logging out ;(
11-12-2013, 06:25 AM
Deadlocks are easy. They mostly get detected in the cDeadlockDetect class, which breaks into the debugger, and then you can examine each thread whether it's waiting for a critical section (has EnterCriticalSection in its call stack); then you can switch to that stack level and examine the critical section, you can then see which other thread currently owns the critical section, through cCriticalSection's m_OwningThreadID. This way you can trace what is holding what.
Your problem is that you're calling m_OwnerObject->IsDestroyed() although you haven't checked if it's not NULL - if the name is (non-)empty but the object is NULL, the function is called on a NULL object.
I'm currently using
I think you don't need the IsDestroyed() check; it is unreliable (another thread can destroy the cPlayer object anywhere in the middle of this entire function - if the player is in another world). Your code is more or less breaking the very purpose of callbacks - not to have objects stored outside of the safety of the callbacks.
To be safe now, I'd use the scenario of remembering only the player name and using the DoWithPlayer() callback to directly set the destination, rather than remembering the player object:
Thats basicly the code there is now. Maybe we can even create an cPet class?
11-12-2013, 07:14 AM
No need to, these will be moved out of the individual mob classes into behavior classes that the AI will use.
11-14-2013, 12:10 AM
Creeper World 3 has been released, and therefore I haven't had much time for the last week
http://knucklecracker.com/
11-14-2013, 08:11 AM
I have (hopefully) set up a loop at Tip4Commit, so that all the BTC that I receive for my commits go back to the project as donations. Hopefully this can motivate a few people to keep committing
11-14-2013, 05:33 PM
Cool!
| ||||
« Next Oldest | Next Newest »
|