← Back to team overview

mudlet-makers team mailing list archive

[Bug 1074775] Re: Crash on pathfinding

 

This patch is bad and leads to room map corruption -> before using the
expression room[id] you must make absoultely sure that the key id exists
in the map rooms otherwise the overloaded [ ] constructor will
automatically add an undefined room object for this key messing up the
map entirely.

I'll fix this myself.

** Changed in: mudlet
       Status: New => Fix Released

-- 
You received this bug notification because you are a member of Mudlet
Makers, which is subscribed to Mudlet.
https://bugs.launchpad.net/bugs/1074775

Title:
  Crash on pathfinding

Status in Mudlet the MUD client:
  Fix Released

Bug description:
  Crashed on pathfinding with:

  0	TMap::initGraph	TMap.cpp	970	0x5da0ef	
  1	TMap::findPath	TMap.cpp	985	0x5da2d8	
  2	TMap::gotoRoom	TMap.cpp	767	0x5d84e2	

  The code in question gets the room weight of a special exit:

          if( rooms[i]->other.size() > 0 )
          {
              QMapIterator<int, QString> it( rooms[i]->other );
              while( it.hasNext() )
              {
                  it.next();
                  int _id = it.key();
                  if( ! rooms[i]->hasSpecialExitLock( _id, it.value() ) )
                  {
                      edgeCount++;
                      edge_descriptor e;
                      bool inserted;
                      tie(e, inserted) = add_edge( i,
                                                   _id,
                                                   g );
                      weightmap[e] = rooms[_id]->weight;
                  }
              }
          }

To manage notifications about this bug go to:
https://bugs.launchpad.net/mudlet/+bug/1074775/+subscriptions


References