[wpdev-commits] wolfpack mapobjects.cpp,1.22,1.23
Brought to you by:
rip,
thiagocorrea
From: HellRaider <hel...@us...> - 2004-11-04 19:33:33
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19397 Modified Files: mapobjects.cpp Log Message: Added a check to the MapObjects::updateOnlineStatus() method. Index: mapobjects.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/mapobjects.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** mapobjects.cpp 4 Nov 2004 12:03:12 -0000 1.22 --- mapobjects.cpp 4 Nov 2004 19:33:21 -0000 1.23 *************** *** 28,31 **** --- 28,32 ---- // Wolfpack Includes #include "timing.h" + #include "console.h" #include "inlines.h" #include "uobject.h" *************** *** 311,319 **** } ! bool add( cUObject *object ) { const Coord &pos = object->pos(); cell( cellId( pos.x, pos.y ) ).add( object ); - return true; } --- 312,321 ---- } ! //! add() never fails, no need to return a bool. It doesn't validate the ! //! object's position, as that can be more effectively done by the caller. ! void add( cUObject *object ) { const Coord &pos = object->pos(); cell( cellId( pos.x, pos.y ) ).add( object ); } *************** *** 544,548 **** MapObjectsGrid *from = ( online ? &gridSet->offlineChars : &gridSet->chars ); MapObjectsGrid *to = ( online ? &gridSet->chars : &gridSet->offlineChars ); ! from->remove( player ); to->add( player ); } --- 546,557 ---- MapObjectsGrid *from = ( online ? &gridSet->offlineChars : &gridSet->chars ); MapObjectsGrid *to = ( online ? &gridSet->chars : &gridSet->offlineChars ); ! ! if( from->remove( player ) == false ) ! { ! Console::instance()->log( LOG_ERROR, tr( "updateOnlineStatus() failed to remove the player 0x%1 from the %2 characters structure." ) ! .arg( player->serial(), 0, 16 ).arg( online ? "offline" : "online" ) ); ! return; ! } ! to->add( player ); } |