Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20076
Modified Files:
ChangeLog player.cpp sectors.cpp sectors.h timing.cpp
walking.cpp
Log Message:
python fixes.
new code for allshow support
Index: sectors.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/sectors.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** sectors.h 15 Jun 2004 02:44:44 -0000 1.11
--- sectors.h 7 Sep 2004 03:21:47 -0000 1.12
***************
*** 131,134 ****
--- 131,135 ----
{
MT_CHARS,
+ MT_CHARSANDOFFLINE,
MT_ITEMS
};
***************
*** 157,163 ****
cItemSectorIterator* findItems( const Coord_cl& center, unsigned char distance );
! cCharSectorIterator* findChars( unsigned char map, uint x, uint y ); // Find items in a specific block
! cCharSectorIterator* findChars( unsigned char map, uint x1, uint y1, uint x2, uint y2 );
! cCharSectorIterator* findChars( const Coord_cl& center, unsigned char distance );
};
--- 158,164 ----
cItemSectorIterator* findItems( const Coord_cl& center, unsigned char distance );
! cCharSectorIterator* findChars( unsigned char map, uint x, uint y, bool includeoffline = false ); // Find items in a specific block
! cCharSectorIterator* findChars( unsigned char map, uint x1, uint y1, uint x2, uint y2, bool includeoffline = false );
! cCharSectorIterator* findChars( const Coord_cl& center, unsigned char distance, bool includeoffline = false );
};
***************
*** 172,176 ****
cCharSectorIterator* iter;
public:
! RegionIterator4Chars( const Coord_cl& pos, unsigned int distance = 18 );
virtual ~RegionIterator4Chars();
--- 173,177 ----
cCharSectorIterator* iter;
public:
! RegionIterator4Chars( const Coord_cl& pos, unsigned int distance = 18, bool offline = false );
virtual ~RegionIterator4Chars();
Index: ChangeLog
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/ChangeLog,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** ChangeLog 7 Sep 2004 00:34:38 -0000 1.37
--- ChangeLog 7 Sep 2004 03:21:46 -0000 1.38
***************
*** 26,29 ****
--- 26,38 ----
- Fixed a bug where tooltips were sent before the actual character.
- Logged out players are no longer visible to GMs without the allshow flag.
+ - Python objects of the type "long" can now be assigned to integer properties
+ without explicit casting.
+ - Implemented a fix for the allshow command not showing characters by letting them
+ stay in the sector map. Please note that this will have a performance impact but
+ it will be optimized later on.
+ - Corrected the return values of the setattr functions for items and characters.
+ They now correctly return -1 if an exception has been raised.
+ - Python longs passed to item.settag and char.settag are now interpreted as integers.
+ - Char.settag and item.settag now correctly fail if the type of the value is not supported.
Wolfpack 12.9.9 Beta (4. September 2004)
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.128
retrieving revision 1.129
diff -C2 -d -r1.128 -r1.129
*** player.cpp 7 Sep 2004 00:34:38 -0000 1.128
--- player.cpp 7 Sep 2004 03:21:46 -0000 1.129
***************
*** 559,563 ****
pMount->fight( 0 );
pMount->setStablemasterSerial( serial_ );
- MapObjects::instance()->remove( pMount );
}
else
--- 559,562 ----
***************
*** 1458,1464 ****
if ( !character->isAtWar() && skillValue( SPIRITSPEAK ) < 1000 )
{
! // It's not enough to be priviledged. You need allshow = 1 to
! // 'see dead people'
! if ( !privileged || ( account_ && account_->isAllShow() ) )
{
return false;
--- 1457,1461 ----
if ( !character->isAtWar() && skillValue( SPIRITSPEAK ) < 1000 )
{
! if ( !privileged )
{
return false;
Index: walking.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/walking.cpp,v
retrieving revision 1.145
retrieving revision 1.146
diff -C2 -d -r1.145 -r1.146
*** walking.cpp 7 Sep 2004 00:32:05 -0000 1.145
--- walking.cpp 7 Sep 2004 03:21:47 -0000 1.146
***************
*** 545,549 ****
pChar->setDirection( dir );
! RegionIterator4Chars ri( pChar->pos() );
for ( ri.Begin(); !ri.atEnd(); ri++ )
{
--- 545,549 ----
pChar->setDirection( dir );
! RegionIterator4Chars ri( pChar->pos(), 18, true );
for ( ri.Begin(); !ri.atEnd(); ri++ )
{
Index: timing.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/timing.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** timing.cpp 13 Aug 2004 08:55:26 -0000 1.12
--- timing.cpp 7 Sep 2004 03:21:47 -0000 1.13
***************
*** 271,275 ****
player->setLogoutTime( 0 );
player->resend( false );
! MapObjects::instance()->remove( player );
}
}
--- 271,275 ----
player->setLogoutTime( 0 );
player->resend( false );
! //MapObjects::instance()->remove( player );
}
}
Index: sectors.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/sectors.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** sectors.cpp 10 Aug 2004 03:15:57 -0000 1.29
--- sectors.cpp 7 Sep 2004 03:21:46 -0000 1.30
***************
*** 391,400 ****
// The same check for players
! P_PLAYER player = dynamic_cast<P_PLAYER>( object );
if ( player && !player->socket() && !player->logoutTime() )
{
return;
! }
P_CHAR pChar = dynamic_cast<P_CHAR>( object );
--- 391,400 ----
// The same check for players
! /*P_PLAYER player = dynamic_cast<P_PLAYER>( object );
if ( player && !player->socket() && !player->logoutTime() )
{
return;
! }*/
P_CHAR pChar = dynamic_cast<P_CHAR>( object );
***************
*** 467,471 ****
}
-
for ( xBlock = x1 / SECTOR_SIZE; xBlock <= x2 / SECTOR_SIZE; xBlock++ )
for ( yBlock = y1 / SECTOR_SIZE; yBlock <= y2 / SECTOR_SIZE; yBlock++ )
--- 467,470 ----
***************
*** 491,496 ****
cUObject* object = sector->grid[block]->data[i];
! if ( object->pos().x >= x1 && object->pos().y >= y1 && object->pos().x <= x2 && object->pos().y <= y2 )
! items[offset++] = object;
}
}
--- 490,506 ----
cUObject* object = sector->grid[block]->data[i];
! if ( object->pos().x >= x1 && object->pos().y >= y1 && object->pos().x <= x2 && object->pos().y <= y2 ) {
! // This sucks but we don't have much choice
! if (type == MT_CHARS) {
! P_PLAYER player = dynamic_cast<P_PLAYER>(object);
!
! // Exclude logged out players.
! if (!player || player->socket() || player->logoutTime()) {
! items[offset++] = object;
! }
! } else {
! items[offset++] = object;
! }
! }
}
}
***************
*** 510,513 ****
--- 520,524 ----
case MT_CHARS:
+ case MT_CHARSANDOFFLINE:
return new cCharSectorIterator( offset, items );
***************
*** 535,538 ****
--- 546,550 ----
case MT_CHARS:
+ case MT_CHARSANDOFFLINE:
return new cCharSectorIterator( count, items );
***************
*** 548,554 ****
}
! cCharSectorIterator* cSectorMaps::findChars( const Coord_cl& center, unsigned char distance )
{
! return findChars( center.map, QMAX( ( int ) center.x - distance, 0 ), QMAX( ( int ) center.y - distance, 0 ), center.x + distance, center.y + distance );
}
--- 560,566 ----
}
! cCharSectorIterator* cSectorMaps::findChars( const Coord_cl& center, unsigned char distance, bool includeoffline )
{
! return findChars( center.map, QMAX( ( int ) center.x - distance, 0 ), QMAX( ( int ) center.y - distance, 0 ), center.x + distance, center.y + distance, includeoffline );
}
***************
*** 566,570 ****
}
! cCharSectorIterator* cSectorMaps::findChars( unsigned char map, uint x, uint y )
{
std::map<unsigned char, cSectorMap*>::const_iterator it = charmaps.find( map );
--- 578,582 ----
}
! cCharSectorIterator* cSectorMaps::findChars( unsigned char map, uint x, uint y, bool includeoffline )
{
std::map<unsigned char, cSectorMap*>::const_iterator it = charmaps.find( map );
***************
*** 576,580 ****
}
! return static_cast<cCharSectorIterator*>( findObjects( MT_CHARS, it->second, x, y ) );
}
--- 588,596 ----
}
! if (includeoffline) {
! return static_cast<cCharSectorIterator*>( findObjects( MT_CHARS, it->second, x, y ) );
! } else {
! return static_cast<cCharSectorIterator*>( findObjects( MT_CHARSANDOFFLINE, it->second, x, y ) );
! }
}
***************
*** 592,596 ****
}
! cCharSectorIterator* cSectorMaps::findChars( unsigned char map, uint x1, uint y1, uint x2, uint y2 )
{
std::map<unsigned char, cSectorMap*>::const_iterator it = charmaps.find( map );
--- 608,612 ----
}
! cCharSectorIterator* cSectorMaps::findChars( unsigned char map, uint x1, uint y1, uint x2, uint y2, bool includeoffline )
{
std::map<unsigned char, cSectorMap*>::const_iterator it = charmaps.find( map );
***************
*** 602,606 ****
}
! return static_cast<cCharSectorIterator*>( findObjects( MT_CHARS, it->second, x1, y1, x2, y2 ) );
}
--- 618,626 ----
}
! if (includeoffline) {
! return static_cast<cCharSectorIterator*>( findObjects( MT_CHARSANDOFFLINE, it->second, x1, y1, x2, y2 ) );
! } else {
! return static_cast<cCharSectorIterator*>( findObjects( MT_CHARS, it->second, x1, y1, x2, y2 ) );
! }
}
***************
*** 620,626 ****
* Old Region Iterators
*/
! RegionIterator4Chars::RegionIterator4Chars( const Coord_cl& pos, unsigned int distance )
{
! iter = SectorMaps::instance()->findChars( pos, distance );
}
--- 640,646 ----
* Old Region Iterators
*/
! RegionIterator4Chars::RegionIterator4Chars( const Coord_cl& pos, unsigned int distance, bool offline )
{
! iter = SectorMaps::instance()->findChars( pos, distance, offline );
}
|