Page 1 of 1
[Solved] "only one flySpectator allowed"
Posted: Wed Jun 06, 2007 10:47 pm
by x3n
When I start michi's moonstation level a second time, Orxonox crashes.
errorlog:
Assertion failed: ghost == NULL && "only one flySpectator allowed", file world_entities/spectator.cc, line 138
Looks like the spectator doesn't get destroyed when the level ends.
Maybe someone could have a look at that.
Posted: Thu Jun 07, 2007 2:10 pm
by patrick
Spectator is a world entity and therefore _should_ be destroyed like every other WE. in theory
Where do they get the spectator reference from? Perhaps that pointer is not reset properly.
Posted: Fri Jun 08, 2007 8:53 am
by chrigi
In which branch does this happen?
Posted: Fri Jun 08, 2007 4:23 pm
by x3n
Main branch; trunk
Posted: Fri Jun 08, 2007 4:55 pm
by x3n
Adding the marked line to the destructor in spectator.cc solves the problem, but I don't know if this is a good solution.
Code: Select all
Spectator::~Spectator ()
{
this->setPlayer(NULL);
ghost = NULL; <-----------------------
}
Posted: Sat Jun 09, 2007 9:56 am
by chrigi
x3n wrote:Adding the marked line to the destructor in spectator.cc solves the problem, but I don't know if this is a good solution.
Code: Select all
Spectator::~Spectator ()
{
this->setPlayer(NULL);
ghost = NULL; <-----------------------
}
I suggest this solution. so deleting of an other spectator won't set ghost = NULL
Code: Select all
Spectator::~Spectator ()
{
this->setPlayer(NULL);
if ( this == ghost )
ghost = NULL;
}
Does this solve the problem?
Could someone commit this? I can't!
Code: Select all
Sending src/world_entities/spectator.cc
svn: Commit failed (details follow):
svn: CHECKOUT of '/orxonox/!svn/ver/10618/trunk/src/world_entities/spectator.cc': 403 Forbidden (https://svn.orxonox.net)
Posted: Sat Jun 09, 2007 11:50 am
by silvan
chrigi wrote:
Code: Select all
Spectator::~Spectator ()
{
this->setPlayer(NULL);
if ( this == ghost )
ghost = NULL;
}
Does this solve the problem?
Could someone commit this? I can't!
Code: Select all
Sending src/world_entities/spectator.cc
svn: Commit failed (details follow):
svn: CHECKOUT of '/orxonox/!svn/ver/10618/trunk/src/world_entities/spectator.cc': 403 Forbidden (https://svn.orxonox.net)
Done. It's in the trunk.
Posted: Sat Jun 09, 2007 12:49 pm
by x3n
Thx chrigi, good idea with "this == ghost".
And yes, it seems to work perfectly
@silvan: Thx for commiting
Posted: Sat Jun 09, 2007 9:39 pm
by chrigi
@x3n: Thx for reporting
