• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved Crash: Editing player.cpp

Summ

(\/)(;,,;)(\/) Y not?
Staff member
Global Moderator
Joined
Oct 15, 2008
Messages
4,136
Solutions
12
Reaction score
1,115
Location
Germany :O
Hey guys,
I need someone with experience regarding the scources.

I have added a new struct variable to player.cpp.
In the struct contains a AutoList which stores players.

The problem is if the player logsout the server crashes.
I detected that it happens when "freeThing(creature);" is called in:
bool Game::removeCreature(Creature* creature, bool isLogout /*= true*/)

However the server only crashs if the struct was edited, even if I clear the list before that function is called or reset the struct to default it will still crash.
 
Last edited:
how do you store players? as pointers to player objects?
prolly after logout u having null pointers in ur struct, idk

or you're using it like ?
Code:
static AutoList<Player> autoList;

did you added autoList.erase before freeThing~?
 
Yea it's a autoList of pointers towards the objects.
But the list is cleared beforehand.. I am out of ideas.

Edit:
Yea all elements are erased before freeThing(..) is called. I even tried autoList.clear()
 
Last edited:
Problem solved.
The source of the problem was a typo in my code.
 
Last edited:

Similar threads

Back
Top