wpdev-commits Mailing List for Wolfpack Emu (Page 2)
Brought to you by:
rip,
thiagocorrea
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(14) |
Aug
(121) |
Sep
(256) |
Oct
(59) |
Nov
(73) |
Dec
(120) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(259) |
Feb
(381) |
Mar
(501) |
Apr
(355) |
May
(427) |
Jun
(270) |
Jul
(394) |
Aug
(412) |
Sep
(724) |
Oct
(578) |
Nov
(65) |
Dec
|
From: Sebastian H. <dar...@us...> - 2004-11-03 18:24:10
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6810 Modified Files: ChangeLog defines.h Log Message: fixed multi update range Index: defines.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/defines.h,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** defines.h 29 Aug 2004 20:40:50 -0000 1.58 --- defines.h 3 Nov 2004 18:23:58 -0000 1.59 *************** *** 46,50 **** #define VISRANGE 18 // Visibility for normal items ! #define BUILDRANGE 22 // Visibility for castles and keeps // Verdata Settings --- 46,50 ---- #define VISRANGE 18 // Visibility for normal items ! #define BUILDRANGE 41 // Visibility for castles and keeps // Verdata Settings Index: ChangeLog =================================================================== RCS file: /cvsroot/wpdev/wolfpack/ChangeLog,v retrieving revision 1.132 retrieving revision 1.133 diff -C2 -d -r1.132 -r1.133 *** ChangeLog 3 Nov 2004 17:23:10 -0000 1.132 --- ChangeLog 3 Nov 2004 18:23:58 -0000 1.133 *************** *** 35,38 **** --- 35,39 ---- - Fixed a bug in the new ContainerCopyIterator. - Fixed movement not correctly being sent to other characters. + - Fixed Multi Update range. Wolfpack 12.9.12 Beta (18. October 2004) |
From: Sebastian H. <dar...@us...> - 2004-11-03 17:23:19
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26443 Modified Files: ChangeLog walking.cpp Log Message: Movement fix. Index: walking.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/walking.cpp,v retrieving revision 1.160 retrieving revision 1.161 diff -C2 -d -r1.160 -r1.161 *** walking.cpp 3 Nov 2004 04:47:01 -0000 1.160 --- walking.cpp 3 Nov 2004 17:23:10 -0000 1.161 *************** *** 630,634 **** pChar->setDirection( dir ); ! MapCharsIterator ri = MapObjects::instance()->listCharsInCircle( pChar->pos(), VISRANGE ); for( P_CHAR observer = ri.first(); observer; observer = ri.next() ) { --- 630,637 ---- pChar->setDirection( dir ); ! Coord upperLeft = pChar->pos() + Coord(- (VISRANGE + 1), - (VISRANGE + 1)); ! Coord lowerRight = pChar->pos() + Coord(VISRANGE + 1, VISRANGE + 1); ! ! MapCharsIterator ri = MapObjects::instance()->listCharsInRect(upperLeft, lowerRight); for( P_CHAR observer = ri.first(); observer; observer = ri.next() ) { *************** *** 636,666 **** continue; ! unsigned int oldDistance = observer->pos().distance( oldpos ); // If we are a player, send us new characters ! if( player && player->socket() ) ! { ! // was that observer previously out of range? ! if( oldDistance >= player->visualRange() ) ! { ! player->socket()->sendChar( observer ); } } // Send our movement to the observer ! P_PLAYER otherplayer = dynamic_cast<P_PLAYER>( observer ); ! if( otherplayer && otherplayer->socket() ) ! { ! if( oldDistance > otherplayer->visualRange() ) ! { ! // previously we were out of range ! otherplayer->socket()->sendChar( pChar ); ! } ! else ! { ! // previously we were already known ! otherplayer->socket()->updateChar( pChar ); } } } --- 639,670 ---- continue; ! bool wasVisible = observer->pos().distance(oldpos) <= VISRANGE; // We were previously in range ! bool isVisible = player->dist(observer) <= VISRANGE; // We are now in range // If we are a player, send us new characters ! if( player && player->socket() ) { ! // Send the observer to us if he was previously not visible and came into range recently ! if( !wasVisible && isVisible ) { ! player->socket()->sendChar(observer); } } // Send our movement to the observer ! P_PLAYER otherplayer = dynamic_cast<P_PLAYER>(observer); ! if (!otherplayer || !otherplayer->socket()) { ! continue; // Skip this character, it's a player. ! // TODO: OnSeePlayer, OnLoosePlayer ! } ! ! if (wasVisible) { ! if (isVisible) { ! otherplayer->socket()->updateChar(pChar); // We walked inside the visible range ! } else { ! otherplayer->socket()->removeObject(pChar); // We walked out of visible range } + + } else if (isVisible) { + otherplayer->socket()->sendChar(pChar); // We walked into visible range } } Index: ChangeLog =================================================================== RCS file: /cvsroot/wpdev/wolfpack/ChangeLog,v retrieving revision 1.131 retrieving revision 1.132 diff -C2 -d -r1.131 -r1.132 *** ChangeLog 3 Nov 2004 13:51:08 -0000 1.131 --- ChangeLog 3 Nov 2004 17:23:10 -0000 1.132 *************** *** 34,37 **** --- 34,38 ---- - Fixed adding items to the MapObjects. - Fixed a bug in the new ContainerCopyIterator. + - Fixed movement not correctly being sent to other characters. Wolfpack 12.9.12 Beta (18. October 2004) |
From: Sebastian H. <dar...@us...> - 2004-11-03 16:49:13
|
Update of /cvsroot/wpdev/xmlscripts/scripts/skills In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18549/skills Modified Files: poisoning.py Log Message: Index: poisoning.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/poisoning.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** poisoning.py 24 Oct 2004 23:12:18 -0000 1.9 --- poisoning.py 3 Nov 2004 16:49:02 -0000 1.10 *************** *** 65,69 **** global ALLOWED ! if not target.item.id in ALLOWED: char.socket.clilocmessage(1060204) return --- 65,69 ---- global ALLOWED ! if not target.item.id in ALLOWED and not target.item.hasscript('food'): char.socket.clilocmessage(1060204) return |
From: Sebastian H. <dar...@us...> - 2004-11-03 16:49:13
|
Update of /cvsroot/wpdev/xmlscripts/scripts/system In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18549/system Modified Files: spawns.py Log Message: Index: spawns.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/system/spawns.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** spawns.py 17 Oct 2004 23:35:48 -0000 1.10 --- spawns.py 3 Nov 2004 16:49:02 -0000 1.11 *************** *** 61,80 **** # This is a minimum/maximum spawn interval in minutes ! mininterval = 1 ! maxinterval = 1 ! if item.hastag('interval'): ! interval = item.gettag('interval') ! if ',' in interval: ! (mininterval, maxinterval) = interval.split(',', 1) ! try: ! mininterval = max(1, int(mininterval)) ! maxinterval = max(1, int(maxinterval)) ! if maxinterval < mininterval: ! temp = mininterval ! mininterval = maxinterval ! maxinterval = temp ! except: ! mininterval = 1 ! maxinterval = 1 # Currently / Maximimum spawned by this gem --- 61,77 ---- # This is a minimum/maximum spawn interval in minutes ! mininterval = 5 ! if item.hastag('mininterval'): ! try: ! mininterval = int(item.gettag('mininterval')) ! except: ! mininterval = 10 ! ! maxinterval = mininterval ! if item.hastag('maxinterval'): ! try: ! maxinterval = int(item.gettag('maxinterval')) ! except: ! maxinterval = 10 # Currently / Maximimum spawned by this gem *************** *** 109,113 **** # If we didn't have a spawntime set yet. if nextspawn == 0 and current < maximum: ! item.settag('nextspawn', currenttime + random.randint(mininterval, maxinterval) * 60 * 1000) continue --- 106,112 ---- # If we didn't have a spawntime set yet. if nextspawn == 0 and current < maximum: ! delay = random.randint(mininterval, maxinterval) * 60 * 1000 ! item.settag('nextspawn', currenttime + delay) ! console.log(LOG_MESSAGE, "Set spawntime for spawngem 0x%x to %u miliseconds in the future.\n" % (item.serial, delay)) continue |
From: Sebastian H. <dar...@us...> - 2004-11-03 16:48:36
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18441/python Modified Files: global.cpp Log Message: Fixes Index: global.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/global.cpp,v retrieving revision 1.169 retrieving revision 1.170 diff -C2 -d -r1.169 -r1.170 *** global.cpp 3 Nov 2004 02:09:32 -0000 1.169 --- global.cpp 3 Nov 2004 16:48:24 -0000 1.170 *************** *** 701,707 **** \param y The y component of the coordinate. \param map The map to look on. ! \param range Defaults to 1. ! This is the range in which the server should search for items. Please remember that this is not ! a circle. \return A list of <object id="item">item</object> objects. \description This function searches for dynamic items (no static items) at the given --- 701,706 ---- \param y The y component of the coordinate. \param map The map to look on. ! \param range Defaults to 0. ! The range of the circle to search in \return A list of <object id="item">item</object> objects. \description This function searches for dynamic items (no static items) at the given *************** *** 715,724 **** y = 0, map = 0, ! range = 1; if ( !PyArg_ParseTuple( args, "iii|i:wolfpack.items", &x, &y, &map, &range ) ) return 0; Coord pos( x, y, 0, map ); ! MapItemsIterator iter = MapObjects::instance()->listItemsInCircle( pos, range ); PyObject* list = PyList_New( 0 ); --- 714,728 ---- y = 0, map = 0, ! range = 0; if ( !PyArg_ParseTuple( args, "iii|i:wolfpack.items", &x, &y, &map, &range ) ) return 0; Coord pos( x, y, 0, map ); ! MapItemsIterator iter; ! if (range > 0) { ! iter = MapObjects::instance()->listItemsInCircle( pos, range ); ! } else { ! iter = MapObjects::instance()->listItemsAtCoord(pos); // Suppose this is faster ! } PyObject* list = PyList_New( 0 ); |
From: Sebastian H. <dar...@us...> - 2004-11-03 16:48:36
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18441 Modified Files: mapobjects.cpp Log Message: Fixes Index: mapobjects.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/mapobjects.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** mapobjects.cpp 3 Nov 2004 02:09:29 -0000 1.20 --- mapobjects.cpp 3 Nov 2004 16:48:23 -0000 1.21 *************** *** 776,780 **** SI16 dx = ( pos.x - state.x ); SI16 dy = ( pos.y - state.y ); ! if( ( ( dx * dx ) + ( dy * dy ) ) < state.radius2 ) { return object; --- 776,780 ---- SI16 dx = ( pos.x - state.x ); SI16 dy = ( pos.y - state.y ); ! if( ( ( dx * dx ) + ( dy * dy ) ) <= state.radius2 ) { return object; |
From: Sebastian H. <dar...@us...> - 2004-11-03 14:46:06
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23127/python Modified Files: char.cpp Log Message: More fixes Index: char.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/char.cpp,v retrieving revision 1.205 retrieving revision 1.206 diff -C2 -d -r1.205 -r1.206 *** char.cpp 3 Nov 2004 02:09:32 -0000 1.205 --- char.cpp 3 Nov 2004 14:45:48 -0000 1.206 *************** *** 340,344 **** } ! self->pChar->moveTo( pos ); Py_RETURN_NONE; --- 340,344 ---- } ! self->pChar->moveTo( pos, true ); Py_RETURN_NONE; |
From: Sebastian H. <dar...@us...> - 2004-11-03 14:46:06
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23127 Modified Files: npc.cpp player.cpp spawnregions.cpp territories.cpp uobject.cpp world.cpp Log Message: More fixes Index: territories.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/territories.cpp,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** territories.cpp 3 Nov 2004 02:09:28 -0000 1.59 --- territories.cpp 3 Nov 2004 14:45:47 -0000 1.60 *************** *** 382,386 **** if (rSource) { rSource->addTeleporter(clSource, clDestination); // Add the teleportation spot ! } else { Console::instance()->log(LOG_WARNING, tr("Couldn't find source region for teleporter at %1.").arg(source)); } --- 382,386 ---- if (rSource) { rSource->addTeleporter(clSource, clDestination); // Add the teleportation spot ! } else if(Maps::instance()->hasMap(clSource.map)) { Console::instance()->log(LOG_WARNING, tr("Couldn't find source region for teleporter at %1.").arg(source)); } *************** *** 392,396 **** if (rDestination) { rDestination->addTeleporter(clDestination, clSource); // Add the teleportation spot ! } else { Console::instance()->log(LOG_WARNING, tr("Couldn't find destination region for two-way teleporter at %1.").arg(destination)); } --- 392,396 ---- if (rDestination) { rDestination->addTeleporter(clDestination, clSource); // Add the teleportation spot ! } else if(Maps::instance()->hasMap(clDestination.map)) { Console::instance()->log(LOG_WARNING, tr("Couldn't find destination region for two-way teleporter at %1.").arg(destination)); } Index: uobject.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/uobject.cpp,v retrieving revision 1.191 retrieving revision 1.192 diff -C2 -d -r1.191 -r1.192 *** uobject.cpp 3 Nov 2004 13:51:11 -0000 1.191 --- uobject.cpp 3 Nov 2004 14:45:47 -0000 1.192 *************** *** 133,136 **** --- 133,138 ---- { // place the object onto the map + pos_ = newpos; // This is required since MapObjects transparently checks + // for objects->pos() MapObjects::instance()->add( this ); } Index: player.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v retrieving revision 1.141 retrieving revision 1.142 diff -C2 -d -r1.141 -r1.142 *** player.cpp 3 Nov 2004 02:09:26 -0000 1.141 --- player.cpp 3 Nov 2004 14:45:47 -0000 1.142 *************** *** 102,124 **** void cPlayer::postload( unsigned int version ) { ! // account removed? ! if( account() == 0 ) ! { ! // we need to remove the equipment here. ! cBaseChar::ItemContainer::const_iterator it; ! for( it = content_.begin(); it != content_.end(); ++it ) ! { ! P_ITEM item = *it; ! if( !item ) ! continue; ! item->remove(); ! } ! del(); return; } - - cBaseChar::postload( version ); - MapObjects::instance()->add( this ); } --- 102,114 ---- void cPlayer::postload( unsigned int version ) { ! cBaseChar::postload( version ); ! MapObjects::instance()->add( this ); ! // account removed? ! if( account() == 0 ) { ! Console::instance()->log(LOG_WARNING, tr("Removing player %1 (0x%2) because of missing account.\n").arg(orgName_).arg(serial_, 0, 16)); ! remove(); return; } } Index: world.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v retrieving revision 1.137 retrieving revision 1.138 diff -C2 -d -r1.137 -r1.138 *** world.cpp 3 Nov 2004 02:09:29 -0000 1.137 --- world.cpp 3 Nov 2004 14:45:48 -0000 1.138 *************** *** 438,441 **** --- 438,444 ---- unsigned int lastpercent = 0; unsigned int percent = 0; + QPtrList<cUObject> invalidSpawnregion; + invalidSpawnregion.setAutoDelete(false); + do { *************** *** 510,514 **** object->setSpawnregion(region); } else if (object) { ! object->remove(); } } --- 513,517 ---- object->setSpawnregion(region); } else if (object) { ! invalidSpawnregion.append(object); } } *************** *** 555,563 **** // post process all loaded objects QPtrList<PersistentObject>::const_iterator cit(objects.begin()); - while (cit != objects.end()) { (*cit)->postload(reader.version()); ++cit; } } --- 558,575 ---- // post process all loaded objects QPtrList<PersistentObject>::const_iterator cit(objects.begin()); while (cit != objects.end()) { (*cit)->postload(reader.version()); ++cit; } + + // Delete all objects with an invalid spawnregion + QPtrList<cUObject>::const_iterator sit(invalidSpawnregion.begin()); + while (sit != invalidSpawnregion.end()) { + (*sit)->remove(); + ++sit; + } + + // Flush the delete queue + p->purgePendingObjects(); } Index: spawnregions.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/spawnregions.cpp,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** spawnregions.cpp 3 Nov 2004 13:51:10 -0000 1.83 --- spawnregions.cpp 3 Nov 2004 14:45:47 -0000 1.84 *************** *** 506,509 **** --- 506,511 ---- void cSpawnRegion::spawnSingleNPC() { + unsigned int pointCount = countPoints(); + Coord pos; if ( findValidSpot( pos ) ) *************** *** 562,566 **** // Apply these settings between the inherited npc and the custom settings in the spawnregion // file ! if (countPoints() == 1) { pChar->setWanderType( enHalt ); // Most likely a vendor spawn with only one point pChar->setWanderX1( pos.x ); --- 564,568 ---- // Apply these settings between the inherited npc and the custom settings in the spawnregion // file ! if (pointCount == 1) { pChar->setWanderType( enHalt ); // Most likely a vendor spawn with only one point pChar->setWanderX1( pos.x ); *************** *** 585,590 **** pChar->resend(false); // Resend the NPC onSpawn( pChar ); // Call the onSpawn event ! } else { ! Console::instance()->log(LOG_ERROR, tr("Unable to find valid spot for spawnregion %1.\n").arg(id_)); } } --- 587,594 ---- pChar->resend(false); // Resend the NPC onSpawn( pChar ); // Call the onSpawn event ! ! // Only warn if there is only ONE spot ! } else if(pointCount <= 1) { ! Console::instance()->log(LOG_WARNING, tr("Unable to find valid spot for spawnregion %1.\n").arg(id_)); } } *************** *** 592,596 **** --- 596,602 ---- void cSpawnRegion::spawnSingleItem() { + unsigned int pointCount = countPoints(); Coord pos; + if ( findValidSpot( pos ) ) { *************** *** 653,656 **** --- 659,664 ---- pItem->update(); // Resend the NPC onSpawn( pItem ); // Call the onSpawn event + } else if(pointCount <= 1) { + Console::instance()->log(LOG_WARNING, tr("Unable to find valid spot for spawnregion %1.\n").arg(id_)); } } Index: npc.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v retrieving revision 1.126 retrieving revision 1.127 diff -C2 -d -r1.126 -r1.127 *** npc.cpp 3 Nov 2004 02:09:26 -0000 1.126 --- npc.cpp 3 Nov 2004 14:45:47 -0000 1.127 *************** *** 1453,1457 **** pChar->Init(); pChar->basedef_ = CharBaseDefs::instance()->get( section.latin1() ); ! pChar->moveTo( pos ); pChar->applyDefinition( DefSection ); --- 1453,1457 ---- pChar->Init(); pChar->basedef_ = CharBaseDefs::instance()->get( section.latin1() ); ! pChar->moveTo( pos, true ); pChar->applyDefinition( DefSection ); |
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11944 Modified Files: ChangeLog basechar.cpp content.cpp content.h dragdrop.cpp items.cpp pythonscript.cpp spawnregions.cpp uobject.cpp Log Message: Bugfixes Index: content.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/content.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** content.h 3 Nov 2004 03:34:15 -0000 1.2 --- content.h 3 Nov 2004 13:51:08 -0000 1.3 *************** *** 28,38 **** private: cItem **content; public: ! ContainerContent(const ContainerContent &src) { // Copy content if (!src.content) { content = 0; } else { ! size_t count = src.maxCount() + 2; // How many slots content = new cItem* [count]; for (size_t i = 0; i < count; ++i) { --- 28,43 ---- private: cItem **content; + + ContainerContent(const ContainerContent &src) { + } public: ! ! // Copy the content. ! ContainerContent &operator =(const ContainerContent &src) { // Copy content if (!src.content) { content = 0; } else { ! size_t count = src.maxCount(); // How many slots content = new cItem* [count]; for (size_t i = 0; i < count; ++i) { *************** *** 40,43 **** --- 45,50 ---- } } + + return *this; } Index: dragdrop.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/dragdrop.cpp,v retrieving revision 1.250 retrieving revision 1.251 diff -C2 -d -r1.250 -r1.251 *** dragdrop.cpp 3 Nov 2004 02:09:26 -0000 1.250 --- dragdrop.cpp 3 Nov 2004 13:51:08 -0000 1.251 *************** *** 618,622 **** pItem->removeFromCont(); ! pItem->moveTo( pos ); pItem->update(); --- 618,622 ---- pItem->removeFromCont(); ! pItem->moveTo( pos, true ); pItem->update(); *************** *** 806,810 **** { pItem->removeFromCont(); ! pItem->moveTo( pCont->pos() + Coord( 0, 0, 2 ) ); } --- 806,810 ---- { pItem->removeFromCont(); ! pItem->moveTo( pCont->pos() + Coord( 0, 0, 2 ), true ); } Index: basechar.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v retrieving revision 1.173 retrieving revision 1.174 diff -C2 -d -r1.173 -r1.174 *** basechar.cpp 3 Nov 2004 02:09:23 -0000 1.173 --- basechar.cpp 3 Nov 2004 13:51:08 -0000 1.174 *************** *** 206,210 **** propertyFlags_ = reader.readInt(); murdererSerial_ = reader.readInt(); ! guarding_ = reinterpret_cast<P_CHAR>( reader.readInt() ); // PostProcess hitpointsBonus_ = reader.readShort(); staminaBonus_ = reader.readShort(); --- 206,210 ---- propertyFlags_ = reader.readInt(); murdererSerial_ = reader.readInt(); ! guarding_ = reinterpret_cast<P_CHAR>( static_cast<size_t>(reader.readInt()) ); // PostProcess hitpointsBonus_ = reader.readShort(); staminaBonus_ = reader.readShort(); *************** *** 231,235 **** { // Resolve the guarding_ value. ! SERIAL guarding = ( SERIAL ) guarding_; guarding_ = 0; setGuarding( World::instance()->findChar( guarding ) ); --- 231,235 ---- { // Resolve the guarding_ value. ! SERIAL guarding = static_cast<SERIAL>( reinterpret_cast<size_t>( guarding_ ) ); guarding_ = 0; setGuarding( World::instance()->findChar( guarding ) ); *************** *** 2880,2884 **** else { ! item->moveTo( pos_ ); item->update(); } --- 2880,2884 ---- else { ! item->moveTo( pos_, true ); item->update(); } Index: uobject.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/uobject.cpp,v retrieving revision 1.190 retrieving revision 1.191 diff -C2 -d -r1.190 -r1.191 *** uobject.cpp 3 Nov 2004 02:09:28 -0000 1.190 --- uobject.cpp 3 Nov 2004 13:51:11 -0000 1.191 *************** *** 66,71 **** if ( isScriptChainFrozen() ) { ! unsigned int count = reinterpret_cast<unsigned int>( scriptChain[0] ); ! for ( unsigned int i = 1; i <= count; ++i ) { QCString* str = reinterpret_cast<QCString*>( scriptChain[i] ); --- 66,71 ---- if ( isScriptChainFrozen() ) { ! size_t count = reinterpret_cast<size_t>( scriptChain[0] ); ! for ( size_t i = 1; i <= count; ++i ) { QCString* str = reinterpret_cast<QCString*>( scriptChain[i] ); *************** *** 83,87 **** if ( src.scriptChain ) { ! unsigned int count = reinterpret_cast<unsigned int>( src.scriptChain[0] ); scriptChain = new cPythonScript * [count + 1]; memcpy( scriptChain, src.scriptChain, ( count + 1 ) * sizeof( cPythonScript * ) ); --- 83,87 ---- if ( src.scriptChain ) { ! size_t count = reinterpret_cast<size_t>( src.scriptChain[0] ); scriptChain = new cPythonScript * [count + 1]; memcpy( scriptChain, src.scriptChain, ( count + 1 ) * sizeof( cPythonScript * ) ); *************** *** 163,167 **** offset++; serial_ = atoi( result[offset++] ); ! multi_ = reinterpret_cast<cMulti*>( atoi( result[offset++] ) ); pos_.x = atoi( result[offset++] ); pos_.y = atoi( result[offset++] ); --- 163,167 ---- offset++; serial_ = atoi( result[offset++] ); ! multi_ = reinterpret_cast<cMulti*>( static_cast<size_t>(atoi(result[offset++])) ); pos_.x = atoi( result[offset++] ); pos_.y = atoi( result[offset++] ); *************** *** 302,307 **** if ( frozen && myChain ) { ! unsigned int count = reinterpret_cast<unsigned int>( myChain[0] ); ! for ( unsigned int i = 1; i <= count; ++i ) { QCString* str = reinterpret_cast<QCString*>( myChain[i] ); --- 302,307 ---- if ( frozen && myChain ) { ! size_t count = reinterpret_cast<size_t>( myChain[0] ); ! for ( size_t i = 1; i <= count; ++i ) { QCString* str = reinterpret_cast<QCString*>( myChain[i] ); *************** *** 330,336 **** if ( scriptChain ) { ! unsigned int count = reinterpret_cast<unsigned int>( scriptChain[0] ); ! for ( unsigned int i = 1; i <= count; ++i ) { if ( scriptChain[i]->name() == name ) --- 330,336 ---- if ( scriptChain ) { ! size_t count = reinterpret_cast<size_t>( scriptChain[0] ); ! for ( size_t i = 1; i <= count; ++i ) { if ( scriptChain[i]->name() == name ) *************** *** 360,364 **** if ( scriptChain ) { ! unsigned int count = reinterpret_cast<unsigned int>( *scriptChain ); cPythonScript** newScriptChain = new cPythonScript* [count + 2]; --- 360,364 ---- if ( scriptChain ) { ! size_t count = reinterpret_cast<size_t>( *scriptChain ); cPythonScript** newScriptChain = new cPythonScript* [count + 2]; *************** *** 408,414 **** bool found = false; if (scriptChain) { ! unsigned int count = reinterpret_cast<unsigned int>( scriptChain[0] ); ! for ( unsigned int i = 1; i <= count; ++i ) { if ( scriptChain[i]->name() == name ) --- 408,414 ---- bool found = false; if (scriptChain) { ! size_t count = reinterpret_cast<size_t>( scriptChain[0] ); ! for ( size_t i = 1; i <= count; ++i ) { if ( scriptChain[i]->name() == name ) *************** *** 426,430 **** if ( scriptChain ) { ! unsigned int count = reinterpret_cast<unsigned int>( scriptChain[0] ); if ( count == 1 ) --- 426,430 ---- if ( scriptChain ) { ! size_t count = reinterpret_cast<size_t>( scriptChain[0] ); if ( count == 1 ) *************** *** 439,443 **** newScriptChain[0] = reinterpret_cast<cPythonScript*>( count - 1 ); ! for ( unsigned int i = 1; i <= count; ++i ) { if ( scriptChain[i]->name() != name ) --- 439,443 ---- newScriptChain[0] = reinterpret_cast<cPythonScript*>( count - 1 ); ! for ( size_t i = 1; i <= count; ++i ) { if ( scriptChain[i]->name() != name ) *************** *** 991,996 **** } ! unsigned int count = reinterpret_cast<unsigned int>( scriptChain[0] ); ! for ( unsigned int i = 1; i <= count; ++i ) { QCString* name = new QCString( scriptChain[i]->name() ); --- 991,996 ---- } ! size_t count = reinterpret_cast<size_t>( scriptChain[0] ); ! for ( size_t i = 1; i <= count; ++i ) { QCString* name = new QCString( scriptChain[i]->name() ); *************** *** 1007,1015 **** } ! unsigned int count = reinterpret_cast<unsigned int>( scriptChain[0] ) & ~0x80000000; ! unsigned int pos = 1; scriptChain[0] = 0; ! for ( unsigned int i = 1; i <= count; ++i ) { QCString* name = reinterpret_cast<QCString*>( scriptChain[i] ); --- 1007,1015 ---- } ! size_t count = reinterpret_cast<size_t>( scriptChain[0] ) & ~0x80000000; ! size_t pos = 1; scriptChain[0] = 0; ! for ( size_t i = 1; i <= count; ++i ) { QCString* name = reinterpret_cast<QCString*>( scriptChain[i] ); *************** *** 1038,1042 **** } ! unsigned int count = reinterpret_cast<unsigned int>( scriptChain[0] ); return ( count & 0x80000000 ) != 0; } --- 1038,1042 ---- } ! size_t count = reinterpret_cast<size_t>( scriptChain[0] ); return ( count & 0x80000000 ) != 0; } *************** *** 1050,1055 **** QCString result; ! unsigned int count = reinterpret_cast<unsigned int>( scriptChain[0] ); ! for ( unsigned int i = 1; i <= count; ++i ) { if ( i != count ) --- 1050,1055 ---- QCString result; ! size_t count = reinterpret_cast<size_t>( scriptChain[0] ); ! for ( size_t i = 1; i <= count; ++i ) { if ( i != count ) *************** *** 1075,1079 **** QStringList events = QStringList::split( ",", eventlist ); ! unsigned int i = 1; QStringList::iterator it; --- 1075,1079 ---- QStringList events = QStringList::split( ",", eventlist ); ! size_t i = 1; QStringList::iterator it; Index: ChangeLog =================================================================== RCS file: /cvsroot/wpdev/wolfpack/ChangeLog,v retrieving revision 1.130 retrieving revision 1.131 diff -C2 -d -r1.130 -r1.131 *** ChangeLog 3 Nov 2004 08:21:06 -0000 1.130 --- ChangeLog 3 Nov 2004 13:51:08 -0000 1.131 *************** *** 30,33 **** --- 30,37 ---- - Region calls now list online and offline chars in seperate lists. - Implemented player collision stamina loss in Felucca. + - Fixed lightlevel calculation. + - Fixed the pythonscript* <-> integer conversion warnings by using size_t instead. + - Fixed adding items to the MapObjects. + - Fixed a bug in the new ContainerCopyIterator. Wolfpack 12.9.12 Beta (18. October 2004) Index: items.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v retrieving revision 1.459 retrieving revision 1.460 diff -C2 -d -r1.459 -r1.460 *** items.cpp 3 Nov 2004 02:09:26 -0000 1.459 --- items.cpp 3 Nov 2004 13:51:08 -0000 1.460 *************** *** 129,133 **** { removeFromCont(); ! moveTo( pChar->pos() ); } // Or to the backpack --- 129,133 ---- { removeFromCont(); ! moveTo( pChar->pos(), true ); } // Or to the backpack *************** *** 1100,1104 **** else { ! nItem->moveTo( pos_ ); } return nItem; --- 1100,1104 ---- else { ! nItem->moveTo( pos_, true ); } return nItem; *************** *** 1333,1337 **** if ( containerSerial != INVALID_SERIAL ) { ! container_ = reinterpret_cast<cUObject*>( containerSerial ); setUnprocessed( true ); } --- 1333,1337 ---- if ( containerSerial != INVALID_SERIAL ) { ! container_ = reinterpret_cast<cUObject*>( static_cast<size_t>(containerSerial) ); setUnprocessed( true ); } Index: spawnregions.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/spawnregions.cpp,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** spawnregions.cpp 3 Nov 2004 02:09:27 -0000 1.82 --- spawnregions.cpp 3 Nov 2004 13:51:10 -0000 1.83 *************** *** 642,646 **** pItem->setSpawnregion(this); pItem->setBaseid(id.latin1()); ! pItem->moveTo( pos ); pItem->applyDefinition( parent ); // Apply the definition from the id first --- 642,646 ---- pItem->setSpawnregion(this); pItem->setBaseid(id.latin1()); ! pItem->moveTo( pos, true ); pItem->applyDefinition( parent ); // Apply the definition from the id first Index: pythonscript.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/pythonscript.cpp,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** pythonscript.cpp 3 Nov 2004 02:09:26 -0000 1.59 --- pythonscript.cpp 3 Nov 2004 13:51:08 -0000 1.60 *************** *** 800,810 **** { // Measure ! unsigned int count = reinterpret_cast<unsigned int>( chain[0] ); cPythonScript** copy = new cPythonScript*[count]; ! for ( unsigned int j = 0; j < count; ++j ) copy[j] = chain[j + 1]; // Find a valid handler function ! for ( unsigned int i = 0; i < count; ++i ) { PyObject* result = copy[i]->callEvent( event, args ); --- 800,810 ---- { // Measure ! size_t count = reinterpret_cast<size_t>( chain[0] ); cPythonScript** copy = new cPythonScript*[count]; ! for ( size_t j = 0; j < count; ++j ) copy[j] = chain[j + 1]; // Find a valid handler function ! for ( size_t i = 0; i < count; ++i ) { PyObject* result = copy[i]->callEvent( event, args ); *************** *** 836,846 **** { // Measure ! unsigned int count = reinterpret_cast<unsigned int>( chain[0] ); cPythonScript** copy = new cPythonScript*[count]; ! for ( unsigned int j = 0; j < count; ++j ) copy[j] = chain[j + 1]; // Find a valid handler function ! for ( unsigned int i = 0; i < count; ++i ) { result = copy[i]->callEvent( event, args ); --- 836,846 ---- { // Measure ! size_t count = reinterpret_cast<size_t>( chain[0] ); cPythonScript** copy = new cPythonScript*[count]; ! for ( size_t j = 0; j < count; ++j ) copy[j] = chain[j + 1]; // Find a valid handler function ! for ( size_t i = 0; i < count; ++i ) { result = copy[i]->callEvent( event, args ); *************** *** 867,873 **** if ( event < EVENT_COUNT ) { ! unsigned int count = reinterpret_cast<unsigned int>( *( chain++ ) ); ! for ( unsigned int i = 0; i < count; ++i ) { if ( chain[i]->canHandleEvent( event ) ) --- 867,873 ---- if ( event < EVENT_COUNT ) { ! size_t count = reinterpret_cast<size_t>( *( chain++ ) ); ! for ( size_t i = 0; i < count; ++i ) { if ( chain[i]->canHandleEvent( event ) ) Index: content.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/content.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** content.cpp 2 Nov 2004 20:45:46 -0000 1.1 --- content.cpp 3 Nov 2004 13:51:08 -0000 1.2 *************** *** 11,15 **** ContainerCopyIterator::ContainerCopyIterator(const cItem *item) : pos(0) { ! content = ContainerContent(item->content()); } --- 11,15 ---- ContainerCopyIterator::ContainerCopyIterator(const cItem *item) : pos(0) { ! content = item->content(); } |
From: Sebastian H. <dar...@us...> - 2004-11-03 13:51:41
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11944/python Modified Files: item.cpp Log Message: Bugfixes Index: item.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/item.cpp,v retrieving revision 1.142 retrieving revision 1.143 diff -C2 -d -r1.142 -r1.143 *** item.cpp 3 Nov 2004 02:09:33 -0000 1.142 --- item.cpp 3 Nov 2004 13:51:16 -0000 1.143 *************** *** 192,200 **** // Gather parameters Coord pos = self->pItem->pos(); ! uchar noRemove = 0; if ( PyTuple_Size( args ) == 1 ) { ! if ( !PyArg_ParseTuple( args, "O&|b:item.moveto(coord, [noremove=0])", &PyConvertCoord, &pos, &noRemove ) ) { return 0; --- 192,200 ---- // Gather parameters Coord pos = self->pItem->pos(); ! uchar noRemove = 1; // otherwise it NEVER gets moved to the surface if ( PyTuple_Size( args ) == 1 ) { ! if ( !PyArg_ParseTuple( args, "O&|b:item.moveto(coord, [noremove=1])", &PyConvertCoord, &pos, &noRemove ) ) { return 0; *************** *** 1350,1354 **** { self->pItem->removeFromCont(); ! self->pItem->moveTo( self->pItem->pos() ); } } --- 1350,1354 ---- { self->pItem->removeFromCont(); ! self->pItem->moveTo( self->pItem->pos(), true ); } } |
From: Sebastian H. <dar...@us...> - 2004-11-03 13:51:40
|
Update of /cvsroot/wpdev/wolfpack/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11944/network Modified Files: uosocket.cpp Log Message: Bugfixes Index: uosocket.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/network/uosocket.cpp,v retrieving revision 1.438 retrieving revision 1.439 diff -C2 -d -r1.438 -r1.439 *** uosocket.cpp 3 Nov 2004 02:09:31 -0000 1.438 --- uosocket.cpp 3 Nov 2004 13:51:14 -0000 1.439 *************** *** 2248,2252 **** return; ! // resend items MapItemsIterator itemIt = MapObjects::instance()->listItemsInCircle( _player->pos(), _player->visualRange() ); for( P_ITEM item = itemIt.first(); item; item = itemIt.next() ) --- 2248,2252 ---- return; ! // resend items MapItemsIterator itemIt = MapObjects::instance()->listItemsInCircle( _player->pos(), _player->visualRange() ); for( P_ITEM item = itemIt.first(); item; item = itemIt.next() ) *************** *** 3010,3018 **** if ( region && region->isCave() ) { ! level = wpMax<UI08>( 0, Config::instance()->dungeonLightLevel() - static_cast<int>( _player->fixedLightLevel() ) ); } else { ! level = wpMax<UI08>( 0, Config::instance()->worldCurrentLevel() - static_cast<int>( _player->fixedLightLevel() ) ); } pLight.setLevel( level ); --- 3010,3018 ---- if ( region && region->isCave() ) { ! level = wpMin<int>(0x1f, wpMax<int>( 0, Config::instance()->dungeonLightLevel() - static_cast<int>( _player->fixedLightLevel() ) )); } else { ! level = wpMin<int>(0x1f, wpMax<int>( 0, Config::instance()->worldCurrentLevel() - static_cast<int>( _player->fixedLightLevel() ) )); } pLight.setLevel( level ); |
From: Richard M. <dr...@us...> - 2004-11-03 08:21:20
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17797 Modified Files: ChangeLog Log Message: Oh, this too. Index: ChangeLog =================================================================== RCS file: /cvsroot/wpdev/wolfpack/ChangeLog,v retrieving revision 1.129 retrieving revision 1.130 diff -C2 -d -r1.129 -r1.130 *** ChangeLog 3 Nov 2004 08:19:37 -0000 1.129 --- ChangeLog 3 Nov 2004 08:21:06 -0000 1.130 *************** *** 29,32 **** --- 29,33 ---- - Multis now have their own structure, and are now separate from items. - Region calls now list online and offline chars in seperate lists. + - Implemented player collision stamina loss in Felucca. Wolfpack 12.9.12 Beta (18. October 2004) |
From: Richard M. <dr...@us...> - 2004-11-03 08:19:49
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17526 Modified Files: ChangeLog Log Message: Summarized changes... Index: ChangeLog =================================================================== RCS file: /cvsroot/wpdev/wolfpack/ChangeLog,v retrieving revision 1.128 retrieving revision 1.129 diff -C2 -d -r1.128 -r1.129 *** ChangeLog 30 Oct 2004 16:03:20 -0000 1.128 --- ChangeLog 3 Nov 2004 08:19:37 -0000 1.129 *************** *** 18,21 **** --- 18,32 ---- - Fixed bug #0000364. (Vendors not selling items they bought) - Rewrote the vendor buy handler code. + - Improved the configure script: + Translations are disabled by default now. + Cleaner output. + Fixed a bug with MySQL lib reporting. + - The SectorMaps singleton has been renamed to MapObjects. + - The deprecated RegionIterators have been removed. + - The SectorIterators have also been replaced with a much faster iterator. + - The new iterators don't allocate/copy memory anymore. + - The "range" lookup now looks for items within a real circle. + - Multis now have their own structure, and are now separate from items. + - Region calls now list online and offline chars in seperate lists. Wolfpack 12.9.12 Beta (18. October 2004) |
From: HellRaider <hel...@us...> - 2004-11-03 04:47:11
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20927 Modified Files: mapobjects.h walking.cpp walking.h Log Message: Added player vs character collisions on Felucca (I will make that optional on a per-facet basis). Hopefully fixed an incompatibility with GCC as well. Index: mapobjects.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/mapobjects.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** mapobjects.h 3 Nov 2004 02:09:29 -0000 1.11 --- mapobjects.h 3 Nov 2004 04:47:00 -0000 1.12 *************** *** 228,232 **** private: ! friend class MapObjectsIterator; static cUObject * firstIteration( void *state ); --- 228,235 ---- private: ! friend class MapObjectsIterator<cUObject>; ! friend class MapObjectsIterator<cItem>; ! friend class MapObjectsIterator<cMulti>; ! friend class MapObjectsIterator<cBaseChar>; static cUObject * firstIteration( void *state ); Index: walking.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/walking.h,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** walking.h 3 Nov 2004 02:09:29 -0000 1.30 --- walking.h 3 Nov 2004 04:47:01 -0000 1.31 *************** *** 63,67 **** private: bool consumeStamina( P_PLAYER pChar, bool running ); - bool checkObstacles( P_CHAR pChar, const Coord& newPos, bool running ); bool verifySequence( cUOSocket* socket, Q_UINT8 sequence ) throw(); void checkStealth( P_CHAR ); --- 63,66 ---- Index: walking.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/walking.cpp,v retrieving revision 1.159 retrieving revision 1.160 diff -C2 -d -r1.159 -r1.160 *** walking.cpp 3 Nov 2004 02:09:29 -0000 1.159 --- walking.cpp 3 Nov 2004 04:47:01 -0000 1.160 *************** *** 554,557 **** --- 554,603 ---- } + // Check if we're going to collide with characters + if( player ) + { + // Player vs characters + if( player->socket() && player->pos().map == 0 && !player->account()->isStaff() ) + { + // Currently hard-limiting collisions to Felucca; this should be a server option! + MapCharsIterator charCollisions = MapObjects::instance()->listCharsAtCoord( newCoord ); + for( P_CHAR them = charCollisions.first(); them; them = charCollisions.next() ) + { + if( them == player ) + continue; + + P_PLAYER otherplayer = dynamic_cast<P_PLAYER>( them ); + if( otherplayer && otherplayer->account()->isStaff() ) + continue; // no collisions against the staff + + if( wpAbs<SI08>( newCoord.z - them->pos().z ) < P_M_MAX_Z_CLIMB ) + { + // to push another char we must have maximum stamina + if( player->stamina() >= player->maxStamina() ) + { + player->socket()->clilocMessage( them->isHidden() ? 1019043 : 1019042 ); + player->setStamina( player->stamina() - 10 ); + break; + } + else + { + player->socket()->denyMove( sequence ); + return false; + } + } + } + } + } + else + { + // NPC vs characters + P_NPC npc = dynamic_cast<P_NPC>( pChar ); + if( npc && CheckForCharacterAtXYZ( pChar, newCoord ) ) + { + npc->clearPath(); + return false; + } + } + // Check if the char can move to those new coordinates // It is going to automatically calculate the new coords (!) *************** *** 568,581 **** } - // Check if we're going to collide with characters - if ( !player && CheckForCharacterAtXYZ( pChar, newCoord ) ) - { - P_NPC npc = dynamic_cast<P_NPC>( pChar ); - if ( npc ) { - npc->clearPath(); - } - return false; - } - // We moved so let's update our location pChar->moveTo( newCoord ); --- 614,617 ---- *************** *** 600,611 **** continue; ! unsigned int distance = observer->pos().distance( oldpos ); // If we are a player, send us new characters if( player && player->socket() ) { ! if ( distance >= player->visualRange() ) { - // an observer was previously out of range. player->socket()->sendChar( observer ); } --- 636,647 ---- continue; ! unsigned int oldDistance = observer->pos().distance( oldpos ); // If we are a player, send us new characters if( player && player->socket() ) { ! // was that observer previously out of range? ! if( oldDistance >= player->visualRange() ) { player->socket()->sendChar( observer ); } *************** *** 617,632 **** if( otherplayer && otherplayer->socket() ) { ! if( distance > otherplayer->visualRange() ) { ! otherplayer->socket()->sendChar( pChar ); // Previously we were out of range } else { ! otherplayer->socket()->updateChar( pChar ); // Previously we were already known ! ! // If we are now out of range, remove from view (just to be sure) ! if (pChar->dist( otherplayer ) > otherplayer->visualRange()) { ! otherplayer->socket()->removeObject(pChar); ! } } } --- 653,665 ---- if( otherplayer && otherplayer->socket() ) { ! if( oldDistance > otherplayer->visualRange() ) { ! // previously we were out of range ! otherplayer->socket()->sendChar( pChar ); } else { ! // previously we were already known ! otherplayer->socket()->updateChar( pChar ); } } *************** *** 652,656 **** { // x=x,y=y, and distance btw z's <= MAX STEP ! if( abs( pChar->pos().z - pos.z ) <= P_M_MAX_Z_CLIMB ) { return true; --- 685,689 ---- { // x=x,y=y, and distance btw z's <= MAX STEP ! if( wpAbs<SI08>( pChar->pos().z - pos.z ) <= P_M_MAX_Z_CLIMB ) { return true; *************** *** 829,842 **** } - /*! - This checks the new tile we're moving to - for Character we could eventually bump into. - */ - bool cMovement::checkObstacles( P_CHAR /*pChar*/, const Coord& /*newPos*/, bool /*running*/ ) - { - // TODO: insert code here - return true; - } - Q_UINT16 DynTile( const Coord& pos ) { --- 862,865 ---- |
From: Richard M. <dr...@us...> - 2004-11-03 03:41:45
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11233 Modified Files: inlines.h Log Message: Oops, empty case breaks things. Index: inlines.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/inlines.h,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** inlines.h 3 Nov 2004 03:34:15 -0000 1.35 --- inlines.h 3 Nov 2004 03:41:35 -0000 1.36 *************** *** 100,106 **** // German umlauts can be represented differently switch (c) { - case '': - result.append("ue"); - continue; case 'ü': result.append("ue"); --- 100,103 ---- |
From: Richard M. <dr...@us...> - 2004-11-03 03:34:24
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10240 Modified Files: content.h inlines.h Log Message: Fixed some warnings Index: content.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/content.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** content.h 2 Nov 2004 20:45:46 -0000 1.1 --- content.h 3 Nov 2004 03:34:15 -0000 1.2 *************** *** 127,131 **** size_t count = this->count(); // If there is no content, this will always be zero ! for (int i = 2; i < count + 2; ++i) { if (content[i] == item) { result = true; --- 127,132 ---- size_t count = this->count(); // If there is no content, this will always be zero ! for( unsigned int i = 2; i < count + 2; ++i ) ! { if (content[i] == item) { result = true; *************** *** 145,149 **** // Iterate trough all items. ! for (int i = 2; i < 2 + count; ++i) { if (content[i] != item) { continue; // Skip this item --- 146,151 ---- // Iterate trough all items. ! for( unsigned int i = 2; i < 2 + count; ++i ) ! { if (content[i] != item) { continue; // Skip this item *************** *** 153,157 **** // What we do now is seek ahead and write all following items in the array // one index downwards ! for (int j = i + 1; j < 2 + count; ++j) { content[j - 1] = content[j]; // Swap Values } --- 155,160 ---- // What we do now is seek ahead and write all following items in the array // one index downwards ! for( unsigned int j = i + 1; j < 2 + count; ++j ) ! { content[j - 1] = content[j]; // Swap Values } Index: inlines.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/inlines.h,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** inlines.h 3 Nov 2004 03:31:49 -0000 1.34 --- inlines.h 3 Nov 2004 03:34:15 -0000 1.35 *************** *** 94,98 **** QString result; ! for (int i = 0; i < input.length(); ++i) { QChar c = input.at(i); --- 94,99 ---- QString result; ! for( unsigned int i = 0; i < input.length(); ++i ) ! { QChar c = input.at(i); |
From: Richard M. <dr...@us...> - 2004-11-03 03:31:57
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937 Modified Files: inlines.h Log Message: unicode character fix. Make sure the editor saves in UTF8! Index: inlines.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/inlines.h,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** inlines.h 3 Nov 2004 02:09:26 -0000 1.33 --- inlines.h 3 Nov 2004 03:31:49 -0000 1.34 *************** *** 99,121 **** // German umlauts can be represented differently switch (c) { ! case 'ü': result.append("ue"); continue; ! case 'ä': result.append("ae"); continue; ! case 'ö': result.append("oe"); continue; ! case 'ß': result.append("ss"); continue; ! case 'Ü': result.append("Ue"); continue; ! case 'Ä': result.append("Ae"); continue; ! case 'Ö': result.append("Oe"); continue; --- 99,124 ---- // German umlauts can be represented differently switch (c) { ! case '': result.append("ue"); continue; ! case 'ü': ! result.append("ue"); ! continue; ! case 'ä': result.append("ae"); continue; ! case 'ö': result.append("oe"); continue; ! case 'Ã': result.append("ss"); continue; ! case 'Ã': result.append("Ue"); continue; ! case 'Ã': result.append("Ae"); continue; ! case 'Ã': result.append("Oe"); continue; |
From: Richard M. <dr...@us...> - 2004-11-03 03:12:07
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6731 Modified Files: configure.py Log Message: There, I fixed a bug with mysql displaying the wrong libs. And, I made it a lot cleaner looking for output! Index: configure.py =================================================================== RCS file: /cvsroot/wpdev/wolfpack/configure.py,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** configure.py 3 Nov 2004 01:55:39 -0000 1.41 --- configure.py 3 Nov 2004 03:11:57 -0000 1.42 *************** *** 103,107 **** def checkQt(): ! if sys.platform == "win32": QMAKE_EXECUTABLE = "qmake.exe" --- 103,107 ---- def checkQt(): ! sys.stdout.write("Checking QT Configuration:\n") if sys.platform == "win32": QMAKE_EXECUTABLE = "qmake.exe" *************** *** 109,125 **** QMAKE_EXECUTABLE = "qmake" ! sys.stdout.write( "Checking QTDIR enviroment variable..." ) if ( os.environ.has_key("QTDIR") and os.path.exists( os.environ["QTDIR"] ) ): ! sys.stdout.write( green("ok\n") ) else: ! sys.stdout.write( red("failed") + "\n" ) ! sys.stdout.write( "You must properly setup QTDIR" ) sys.exit(); ! sys.stdout.write( "Searching for qmake..." ) temp = "" QMAKESEARCHPATH = [ os.path.join(os.path.join(os.environ["QTDIR"], "bin"), QMAKE_EXECUTABLE) ] for dir in string.split( os.environ["PATH"], os.path.pathsep ): ! QMAKESEARCHPATH.append( os.path.join(dir, QMAKE_EXECUTABLE) ) qmake_file, qmake_path = findFile(QMAKESEARCHPATH) --- 109,126 ---- QMAKE_EXECUTABLE = "qmake" ! sys.stdout.write( " Checking QTDIR enviroment variable: " ) if ( os.environ.has_key("QTDIR") and os.path.exists( os.environ["QTDIR"] ) ): ! sys.stdout.write( green("Pass\n") ) ! sys.stdout.write( " Found value for QTDIR: %s\n" % os.environ["QTDIR"] ) else: ! sys.stdout.write( red("Fail") + "\n" ) ! sys.stdout.write( " You must properly setup the QTDIR environment variable!\n" ) sys.exit(); ! sys.stdout.write( " Searching for qmake executable: " ) temp = "" QMAKESEARCHPATH = [ os.path.join(os.path.join(os.environ["QTDIR"], "bin"), QMAKE_EXECUTABLE) ] for dir in string.split( os.environ["PATH"], os.path.pathsep ): ! QMAKESEARCHPATH.append( os.path.join( dir, QMAKE_EXECUTABLE ) ) qmake_file, qmake_path = findFile(QMAKESEARCHPATH) *************** *** 127,131 **** qt_qmake = os.path.join(qmake_path, qmake_file) sys.stdout.write( "%s\n" % qt_qmake ) ! return True --- 128,132 ---- qt_qmake = os.path.join(qmake_path, qmake_file) sys.stdout.write( "%s\n" % qt_qmake ) ! sys.stdout.write("\n") return True *************** *** 134,154 **** MySQL_LIBSEARCHPATH = [ sys.prefix + "\Libs\mysqlclient*.lib" ] MySQL_INCSEARCHPATH = [ sys.prefix + "\include\mysql.h" ] ! elif sys.platform == "linux2": ! MySQL_LIBSEARCHPATH = [ \ ! "/usr/local/lib/libmysqlclient*.so", \ ! "/usr/local/lib/mysql/libmysqlclient*.so", \ ! "/usr/lib/libmysqlclient*.so", \ ! "/usr/lib/mysql/libmysqlclient*.so" ] ! MySQL_LIBSTATICSEARCHPATH = [ \ ! "/usr/local/lib/libmysqlclient*.a", \ ! "/usr/local/lib/mysql/libmysqlclient*.a", \ ! "/usr/lib/libmysqlclient*.a", \ ! "/usr/lib/mysql/libmysqlclient*.a" ] ! MySQL_INCSEARCHPATH = [ \ ! "/usr/local/include/mysql.h", \ ! "/usr/local/include/mysql/mysql.h", \ ! "/usr/include/mysql.h", \ ! "/usr/include/mysql/mysql.h" ] ! elif sys.platform == "freebsd4" or sys.platform == "freebsd5": MySQL_LIBSEARCHPATH = [ \ "/usr/local/lib/libmysqlclient*.so", \ --- 135,139 ---- MySQL_LIBSEARCHPATH = [ sys.prefix + "\Libs\mysqlclient*.lib" ] MySQL_INCSEARCHPATH = [ sys.prefix + "\include\mysql.h" ] ! elif sys.platform == "linux2" or sys.platform == "freebsd4" or sys.platform == "freebsd5": MySQL_LIBSEARCHPATH = [ \ "/usr/local/lib/libmysqlclient*.so", \ *************** *** 177,183 **** global mysql_libfile mysql_libfile, mysql_libpath = findFile( MySQL_LIBSEARCHPATH ) if ( mysql_libfile ): ! sys.stdout.write("%s\n" % os.path.join( py_libpath, py_libfile ) ) else: sys.stdout.write("Not Found!\n") --- 162,169 ---- global mysql_libfile + sys.stdout.write( " Searching for MySQL library: " ) mysql_libfile, mysql_libpath = findFile( MySQL_LIBSEARCHPATH ) if ( mysql_libfile ): ! sys.stdout.write("%s\n" % os.path.join( mysql_libpath, mysql_libfile ) ) else: sys.stdout.write("Not Found!\n") *************** *** 186,190 **** global mysql_incpath mysql_incfile = None ! sys.stdout.write( "Searching for MySQL includes... " ) mysql_incfile, mysql_incpath = findFile( MySQL_INCSEARCHPATH ) if ( mysql_incfile ): --- 172,176 ---- global mysql_incpath mysql_incfile = None ! sys.stdout.write( " Searching for MySQL includes: " ) mysql_incfile, mysql_incpath = findFile( MySQL_INCSEARCHPATH ) if ( mysql_incfile ): *************** *** 197,210 **** def checkPython( options, lookForHeaders, lookForLib ): PYTHONINCSEARCHPATH = [ distutils.sysconfig.get_python_inc() + os.path.sep + "Python.h" ] if distutils.sysconfig.get_config_vars().has_key("DESTSHARED"): PYTHONLIBSEARCHPATH = [ distutils.sysconfig.get_config_vars()["DESTSHARED"] + os.path.sep + "libpython*" ] ! else: ! PYTHONLIBSEARCHPATH = [] ! PYTHONLIBSTATICSEARCHPATH = [] if sys.platform == "win32": PYTHONLIBSEARCHPATH += [ sys.prefix + "\Libs\python*.lib" ] PYTHONINCSEARCHPATH += [ sys.prefix + "\include\Python.h" ] ! elif sys.platform == "linux2": PYTHONLIBSEARCHPATH += [ \ "/usr/local/lib/libpython2.3*.so", \ --- 183,203 ---- def checkPython( options, lookForHeaders, lookForLib ): + sys.stdout.write("Checking Python Configuration:\n") + # Default Blank + PYTHONLIBSEARCHPATH = [] + PYTHONLIBSTATICSEARCHPATH = [] + PYTHONINCSEARCHPATH = [] + # Attept to find the system's configuration PYTHONINCSEARCHPATH = [ distutils.sysconfig.get_python_inc() + os.path.sep + "Python.h" ] + if distutils.sysconfig.get_config_vars().has_key("DESTSHARED"): PYTHONLIBSEARCHPATH = [ distutils.sysconfig.get_config_vars()["DESTSHARED"] + os.path.sep + "libpython*" ] ! ! # Windows Search Paths if sys.platform == "win32": PYTHONLIBSEARCHPATH += [ sys.prefix + "\Libs\python*.lib" ] PYTHONINCSEARCHPATH += [ sys.prefix + "\include\Python.h" ] ! # Linux and BSD Search Paths ! elif sys.platform == "linux2" or sys.platform == "freebsd4" or sys.platform == "freebsd5": PYTHONLIBSEARCHPATH += [ \ "/usr/local/lib/libpython2.3*.so", \ *************** *** 222,245 **** "/usr/lib/[Pp]ython2.3*/config/libpython2.3*.a" ] PYTHONINCSEARCHPATH += [ \ "/usr/local/include/[Pp]ython2.3*/Python.h", \ "/usr/include/[Pp]ython2.3*/Python.h" ] ! elif sys.platform == "freebsd4" or sys.platform == "freebsd5": ! PYTHONLIBSEARCHPATH += [ \ ! "/usr/local/lib/libpython2.3*.so", \ ! "/usr/local/lib/[Pp]ython2.3*/libpython2.3*.so", \ ! "/usr/local/lib/[Pp]ython2.3*/config/libpython2.3*.so", \ ! "/usr/lib/libpython2.3*.so", \ ! "/usr/lib/[Pp]ython2.3*/libpython2.3*.so", \ ! "/usr/lib/[Pp]ython2.3*/config/libpython2.3*.so" ] ! PYTHONLIBSTATICSEARCHPATH += [ \ ! "/usr/local/lib/libpython2.3*.a", \ ! "/usr/local/lib/[Pp]ython2.3*/libpython2.3*.a", \ ! "/usr/local/lib/[Pp]ython2.3*/config/libpython2.3*.a", \ ! "/usr/lib/libpython2.3*.a", \ ! "/usr/lib/[Pp]ython2.3*/libpython2.3*.a", \ ! "/usr/lib/[Pp]ython2.3*/config/libpython2.3*.a" ] ! PYTHONINCSEARCHPATH += [ \ ! "/usr/local/include/[Pp]ython2.3*/Python.h", \ ! "/usr/include/[Pp]ython2.3*/Python.h" ] elif sys.platform == "darwin": PYTHONINCSEARCHPATH += [ \ --- 215,223 ---- "/usr/lib/[Pp]ython2.3*/config/libpython2.3*.a" ] PYTHONINCSEARCHPATH += [ \ + "/usr/local/include/Python.h", \ "/usr/local/include/[Pp]ython2.3*/Python.h", \ + "/usr/include/Python.h", \ "/usr/include/[Pp]ython2.3*/Python.h" ] ! # MacOSX Search Paths elif sys.platform == "darwin": PYTHONINCSEARCHPATH += [ \ *************** *** 250,253 **** --- 228,232 ---- "/System/Library/Frameworks/Python.framework/Versions/Current/Python", \ "/System/Library/Frameworks/Python.framework/Versions/Current/lib/[Pp]ython*/config/libpython*.a" ] + # Undefined OS else: sys.stdout.write(red("ERROR")+": Unknown platform %s to checkPython()\n" % sys.platform ) *************** *** 267,301 **** PYTHONLIBSEARCHPATH = [ options.py_libpath ] ! sys.stdout.write( "Checking Python version... " ) if sys.hexversion >= 0x020200F0: sys.stdout.write(green("Pass\n")) else: sys.stdout.write( red("Fail") + "\n" ) ! sys.stdout.write( bold("Wolfpack requires Python version greater than 2.2.0 ") ) sys.exit(); ! sys.stdout.write( "Checking CPU byte order... %s\n" % sys.byteorder ) if sys.byteorder != 'little': sys.stdout.write(yellow("Warning:") + " Wolfpack support for big endian systems is completely experimental and unlikey to work!\n" ) - if lookForLib: - sys.stdout.write( "Searching for Python library... " ) - global py_libpath - global py_libfile - py_libfile = None - py_libpath = None - py_libfile, py_libpath = findFile( PYTHONLIBSEARCHPATH ) - if ( py_libfile ): - sys.stdout.write("%s\n" % os.path.join( py_libpath, py_libfile ) ) - else: - sys.stdout.write(red("Not Found!") + "\n") - sys.exit() - if lookForHeaders: global py_incpath global py_incfile ! py_incfile = None ! py_incpath = None ! sys.stdout.write( "Searching for Python includes... " ) py_incfile, py_incpath = findFile( PYTHONINCSEARCHPATH ) if ( py_incfile ): --- 246,265 ---- PYTHONLIBSEARCHPATH = [ options.py_libpath ] ! sys.stdout.write( " Checking Python version: " ) if sys.hexversion >= 0x020200F0: sys.stdout.write(green("Pass\n")) else: sys.stdout.write( red("Fail") + "\n" ) ! sys.stdout.write( bold(" Wolfpack requires Python version >= 2.3.0\n") ) sys.exit(); ! sys.stdout.write( " Checking CPU byte order: %s\n" % sys.byteorder ) if sys.byteorder != 'little': sys.stdout.write(yellow("Warning:") + " Wolfpack support for big endian systems is completely experimental and unlikey to work!\n" ) if lookForHeaders: global py_incpath global py_incfile ! sys.stdout.write( " Searching for Python includes: " ) py_incfile, py_incpath = findFile( PYTHONINCSEARCHPATH ) if ( py_incfile ): *************** *** 305,309 **** --- 269,284 ---- sys.exit() + if lookForLib: + sys.stdout.write( " Searching for Python library: " ) + global py_libpath + global py_libfile + py_libfile, py_libpath = findFile( PYTHONLIBSEARCHPATH ) + if ( py_libfile ): + sys.stdout.write( "%s\n" % os.path.join( py_libpath, py_libfile ) ) + else: + sys.stdout.write(red("Not Found!") + "\n") + sys.exit() + sys.stdout.write("\n") return True *************** *** 313,317 **** DEFINES = "" CONFIG = "" - # Setup command line parser parser = OptionParser(version="%prog 0.2") --- 288,291 ---- *************** *** 336,339 **** --- 310,326 ---- pyLibSearch = False + # Neat Header + #headerbuffer = " " + #sys.stdout.write( " \n" ) + #sys.stdout.write( headerbuffer + red( " ) (\_ ") + "\n" ) + #sys.stdout.write( headerbuffer + red( " (( _/{ \"-; ") + "\n" ) + #sys.stdout.write( headerbuffer + red( " )).-\" {{ ;\"` ") + "\n" ) + #sys.stdout.write( "Running Wolfpack Configuration: " ) + #sys.stdout.write( red( " ( ( ;._ \\\\ " ) + "\n" ) + #sys.stdout.write( headerbuffer + green( "****************\n" ) ) + + # Check QT Settings + checkQt() + # Check Python Settings checkPython( options, pyIncSearch, pyLibSearch ) *************** *** 341,346 **** CONFIG += "mysql " DEFINES += "MYSQL_DRIVER " checkMySQL(options) ! checkQt() if not options.enable_translation: --- 328,335 ---- CONFIG += "mysql " DEFINES += "MYSQL_DRIVER " + sys.stdout.write("Checking MySQL Configuration:\n") checkMySQL(options) ! sys.stdout.write("\n") ! if not options.enable_translation: *************** *** 382,386 **** CONFIG += "release warn_off " - # if --aidebug if options.enable_aidebug: --- 371,374 ---- *************** *** 401,404 **** --- 389,393 ---- sys.stdout.write(bold(green("Done\n"))) sys.stdout.write(bold("Configure finished. Please run 'make' now.\n")) + sys.stdout.write("\n") if __name__ == "__main__": |
From: Thiago B. <hel...@uo...> - 2004-11-03 03:04:58
|
Hi all, Since this is a large changelog, I'm sending it through email instead of the CVS log. Normally I would prefer to send small, incremental patches, but this time there was no clean way to do the changes incrementally. This is a huge rewrite of the sectors code, and includes many other changes I couldn't commit before. Be prepared to do a clean rebuild.... As I had to change a lot of the server's code, I may have introduced bugs (well, hopefully not). Please help me trace any bugs, and I'll have them fixed ASAP. By the way, as I write there's a new crash-bug in the decay system which was introduced by DarkStorm's new containers code. I believe it has nothing to do with my changes. New sectors code: - The SectorMaps singleton has been renamed to MapObjects. - It's much, much, much, much faster; slightly higher memory usage though. - The old deprecated RegionIterators have been removed. - The not so old SectorIterators have also been removed, in favor of a much faster iterator. - The new iterators don't allocate/copy memory anymore. They're more user friendly as well (no need to delete them). Now the following changes MAY break compatibility with some code: - The "range" lookup, which previously looked for items within a rectangle, now looks for items within a real circle. - Multis now have their own structure, and are no longer part of the items structure. This means multis won't be listed among other items anymore. - There's no way to list both the online and offline chars within a region anymore. Now you can list EITHER the online or the offline chars within a region. Any code that listed both the online and offline chars now would get only the offline chars, and must be updated. The default behaviour of the iterators is still to list the online chars. TODO: - Python iterators must be revamped to get in sync with theses changes. Right now they're functional, but can't access multis. - Take the chance and make the iterators work as real python iterators. Having to call first()/next() from python sucks! - Update the documentation. Other changes I made and couldn't commit before: - Renamed the Coord_cl class to just Coord (that _cl was annoying and out of the project standards). - cUObject::pos() now returns a Coord by reference (was by value, a major eek). - Appended "Type" to the cVariant::Type constants to avoid potential name clashes. - The typedefs from platform.h (e.g. UI32) now map to the Q_INTXX constantes. Now they're really cross-platform... - Replaced all QMAX/QMIN calls with wpMax/wpMin (the former are macros, the latter are template inline functions). Please use the latter. - Added isConnected() and isOnline() to cPlayer. - Changed onLogout() is called. Previously was when the socket disconnected... now is when the char exits the world. - Added the onDisconnect() event to cPlayer (not yet exported to python), called when the socket disconnects. - Walking: items are now sent at the VISRANGE, and multis at BUILDRANGE (both were at BUILDRANGE). - The "allshow" account privilege is no longer used, and should probably be removed. You can no longer see offline characters as you walk. - The "allshow" command now simply reveals the offline characters in your screen. This command should probably be ported to python with another name. -- HellRaider |
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29663 Modified Files: accounts.h basechar.cpp basechar.h basedef.h basics.cpp basics.h combat.cpp combat.h commands.cpp commands.h console.h contextmenu.h coord.cpp coord.h customtags.cpp customtags.h definitions.cpp definitions.h dragdrop.cpp dragdrop.h getopts.h guilds.h inlines.h items.cpp items.h log.h multi.cpp multi.h npc.cpp npc.h persistentbroker.h persistentobject.h platform.h player.cpp player.h pythonscript.cpp pythonscript.h scriptmanager.h server.cpp server.h serverconfig.cpp serverconfig.h singleton.h skills.cpp skills.h spawnregions.cpp spawnregions.h speech.cpp targetrequests.cpp targetrequests.h territories.cpp territories.h timers.cpp timers.h timing.cpp timing.h tracking.cpp trade.cpp typedefs.h uobject.cpp uobject.h uotime.h walking.cpp walking.h wolf.dsp wolfpack.pro wolfpack.vcproj world.cpp world.h Added Files: mapobjects.cpp mapobjects.h Removed Files: sectors.cpp sectors.h Log Message: New sectors code and more. A changelog will be sent to the mailing list. Index: walking.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/walking.h,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** walking.h 3 Sep 2004 16:55:17 -0000 1.29 --- walking.h 3 Nov 2004 02:09:29 -0000 1.30 *************** *** 47,51 **** }/* PACK*/; ! bool mayWalk( P_CHAR pChar, Coord_cl& pos ); class cMovement --- 47,51 ---- }/* PACK*/; ! bool mayWalk( P_CHAR pChar, Coord& pos ); class cMovement *************** *** 58,76 **** void CombatWalk( P_CHAR pc ); void NpcMovement( unsigned int currenttime, P_NPC pc_i ); ! bool canLandMonsterMoveHere( Coord_cl& ) const; ! bool CheckForCharacterAtXYZ( P_CHAR pc, const Coord_cl& pos ); ! Coord_cl calcCoordFromDir( Q_UINT8 dir, const Coord_cl& oldCoords ); private: bool consumeStamina( P_PLAYER pChar, bool running ); ! bool checkObstacles( P_CHAR pChar, const Coord_cl& newPos, bool running ); bool verifySequence( cUOSocket* socket, Q_UINT8 sequence ) throw(); void checkStealth( P_CHAR ); ! void sendWalkToOther( P_PLAYER pChar, P_CHAR pWalker, const Coord_cl& oldpos ); void handleItemCollision( P_CHAR pChar ); ! void handleTeleporters( P_CHAR pc, const Coord_cl& oldpos ); }; ! typedef SingletonHolder<cMovement> Movement; #endif // __WALKING2_H__ --- 58,76 ---- void CombatWalk( P_CHAR pc ); void NpcMovement( unsigned int currenttime, P_NPC pc_i ); ! bool canLandMonsterMoveHere( Coord& ) const; ! bool CheckForCharacterAtXYZ( P_CHAR pc, const Coord& pos ); ! Coord calcCoordFromDir( Q_UINT8 dir, const Coord& oldCoords ); private: bool consumeStamina( P_PLAYER pChar, bool running ); ! bool checkObstacles( P_CHAR pChar, const Coord& newPos, bool running ); bool verifySequence( cUOSocket* socket, Q_UINT8 sequence ) throw(); void checkStealth( P_CHAR ); ! void sendWalkToOther( P_PLAYER pChar, P_CHAR pWalker, const Coord& oldpos ); void handleItemCollision( P_CHAR pChar ); ! void handleTeleporters( P_CHAR pc, const Coord& oldpos ); }; ! typedef Singleton<cMovement> Movement; #endif // __WALKING2_H__ Index: targetrequests.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/targetrequests.h,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** targetrequests.h 24 Sep 2004 04:47:38 -0000 1.75 --- targetrequests.h 3 Nov 2004 02:09:28 -0000 1.76 *************** *** 107,111 **** socket->player()->removeFromView( false ); ! Coord_cl newPos = socket->player()->pos(); newPos.x = target->x(); newPos.y = target->y(); --- 107,111 ---- socket->player()->removeFromView( false ); ! Coord newPos = socket->player()->pos(); newPos.x = target->x(); newPos.y = target->y(); *************** *** 340,344 **** // Move the object relatively ! Coord_cl newPos = pObject->pos() + Coord_cl( x, y, z ); pObject->moveTo( newPos ); --- 340,344 ---- // Move the object relatively ! Coord newPos = pObject->pos() + Coord( x, y, z ); pObject->moveTo( newPos ); Index: persistentobject.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/persistentobject.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** persistentobject.h 19 Aug 2004 01:22:52 -0000 1.15 --- persistentobject.h 3 Nov 2004 02:09:26 -0000 1.16 *************** *** 134,138 **** }; ! typedef SingletonHolder<cBinaryTypemap> BinaryTypemap; /* --- 134,138 ---- }; ! typedef Singleton<cBinaryTypemap> BinaryTypemap; /* *************** *** 188,192 **** }; ! typedef SingletonHolder<cPersistentFactory> PersistentFactory; /* --- 188,192 ---- }; ! typedef Singleton<cPersistentFactory> PersistentFactory; /* Index: timers.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/timers.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** timers.h 25 Sep 2004 02:03:20 -0000 1.8 --- timers.h 3 Nov 2004 02:09:28 -0000 1.9 *************** *** 204,208 **** }; ! typedef SingletonHolder<cTimers> Timers; #endif --- 204,208 ---- }; ! typedef Singleton<cTimers> Timers; #endif Index: timers.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/timers.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** timers.cpp 25 Sep 2004 02:03:20 -0000 1.16 --- timers.cpp 3 Nov 2004 02:09:28 -0000 1.17 *************** *** 41,45 **** #include "persistentbroker.h" #include "skills.h" ! #include "sectors.h" #include "basechar.h" #include "player.h" --- 41,45 ---- #include "persistentbroker.h" #include "skills.h" ! #include "mapobjects.h" #include "basechar.h" #include "player.h" Index: getopts.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/getopts.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** getopts.h 2 Jun 2004 15:04:05 -0000 1.5 --- getopts.h 3 Nov 2004 02:09:26 -0000 1.6 *************** *** 57,61 **** }; ! typedef SingletonHolder<cGetopts> Getopts; #endif --- 57,61 ---- }; ! typedef Singleton<cGetopts> Getopts; #endif Index: definitions.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/definitions.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** definitions.cpp 11 Oct 2004 08:05:10 -0000 1.23 --- definitions.cpp 3 Nov 2004 02:09:25 -0000 1.24 *************** *** 31,35 **** #include <qptrstack.h> #include <qregexp.h> - #include <qvaluestack.h> #include <qstringlist.h> #include <qvaluevector.h> --- 31,34 ---- *************** *** 107,115 **** cDefManagerPrivate* impl; // Element level within the current file ! QValueStack<int> levels; // Holds all read elements. QPtrStack<cElement> elements; // Files stack (each <include> pushes a file) ! QValueStack<QString> filenames; // Locators associated to each document QPtrStack<QXmlLocator> locators; --- 106,114 ---- cDefManagerPrivate* impl; // Element level within the current file ! QValueVector<int> levels; // Holds all read elements. QPtrStack<cElement> elements; // Files stack (each <include> pushes a file) ! QValueVector<QString> filenames; // Locators associated to each document QPtrStack<QXmlLocator> locators; *************** *** 147,151 **** } ! filenames.push( filename ); QXmlInputSource input( &file ); --- 146,150 ---- } ! filenames.push_back( filename ); QXmlInputSource input( &file ); *************** *** 157,161 **** reader.parse( &input, false ); ! filenames.pop(); } --- 156,160 ---- reader.parse( &input, false ); ! filenames.pop_back(); } *************** *** 167,171 **** bool startDocument() { ! levels.push( 0 ); return true; } --- 166,170 ---- bool startDocument() { ! levels.push_back( 0 ); return true; } *************** *** 173,177 **** bool endDocument() { ! levels.pop(); locators.pop(); return true; --- 172,176 ---- bool endDocument() { ! levels.pop_back(); locators.pop(); return true; *************** *** 180,187 **** bool startElement( const QString& /*namespaceURI*/, const QString& localName, const QString& qName, const QXmlAttributes& atts ) { ! levels.top()++; // Ignore document root ! if( levels.top() == 1 ) { if( levels.isEmpty() ) --- 179,186 ---- bool startElement( const QString& /*namespaceURI*/, const QString& localName, const QString& qName, const QXmlAttributes& atts ) { ! levels.back()++; // Ignore document root ! if( levels.back() == 1 ) { if( levels.isEmpty() ) *************** *** 228,232 **** { cElement* element = elements.pop(); ! if( --( levels.top() ) == 0 ) { // Ignore root --- 227,231 ---- { cElement* element = elements.pop(); ! if( --( levels.back() ) == 0 ) { // Ignore root *************** *** 259,263 **** { Console::instance()->log( LOG_WARNING, tr( "Duplicate %1: %2\n[File: %3, Line: %4]\n" ) ! .arg( element->name() ).arg( tagId ).arg( filenames.top() ).arg( locators.current()->lineNumber() ) ); delete element; } --- 258,262 ---- { Console::instance()->log( LOG_WARNING, tr( "Duplicate %1: %2\n[File: %3, Line: %4]\n" ) ! .arg( element->name() ).arg( tagId ).arg( filenames.back() ).arg( locators.current()->lineNumber() ) ); delete element; } *************** *** 278,282 **** Console::instance()->log( LOG_WARNING, tr( "Unknown element: %1\n[File: %2, Line: %3]\n" ) ! .arg( element->name() ).arg( filenames.top() ).arg( locators.current()->lineNumber() ) ); delete element; } --- 277,281 ---- Console::instance()->log( LOG_WARNING, tr( "Unknown element: %1\n[File: %2, Line: %3]\n" ) ! .arg( element->name() ).arg( filenames.back() ).arg( locators.current()->lineNumber() ) ); delete element; } *************** *** 301,305 **** { Console::instance()->log( LOG_WARNING, tr( "%1\n[File: %2, Line: %3, Column: %4" ) ! .arg( exception.message(), filenames.top() ).arg( exception.lineNumber() ).arg( exception.columnNumber() ) ); return true; // continue } --- 300,304 ---- { Console::instance()->log( LOG_WARNING, tr( "%1\n[File: %2, Line: %3, Column: %4" ) ! .arg( exception.message(), filenames.back() ).arg( exception.lineNumber() ).arg( exception.columnNumber() ) ); return true; // continue } *************** *** 307,311 **** { Console::instance()->log( LOG_ERROR, tr( "%1\n[File: %2, Line: %3, Column: %4" ) ! .arg( exception.message(), filenames.top() ).arg( exception.lineNumber() ).arg( exception.columnNumber() ) ); return true; // continue } --- 306,310 ---- { Console::instance()->log( LOG_ERROR, tr( "%1\n[File: %2, Line: %3, Column: %4" ) ! .arg( exception.message(), filenames.back() ).arg( exception.lineNumber() ).arg( exception.columnNumber() ) ); return true; // continue } *************** *** 313,317 **** { Console::instance()->log( LOG_ERROR, tr( "%1\n[File: %2, Line: %3, Column: %4" ) ! .arg( exception.message(), filenames.top() ).arg( exception.lineNumber() ).arg( exception.columnNumber() ) ); return true; // continue } --- 312,316 ---- { Console::instance()->log( LOG_ERROR, tr( "%1\n[File: %2, Line: %3, Column: %4" ) ! .arg( exception.message(), filenames.back() ).arg( exception.lineNumber() ).arg( exception.columnNumber() ) ); return true; // continue } Index: trade.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/trade.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** trade.cpp 2 Nov 2004 20:45:44 -0000 1.16 --- trade.cpp 3 Nov 2004 02:09:28 -0000 1.17 *************** *** 121,130 **** // First check: is the item on the vendor in the specified layer ! if (layer == cBaseChar::BuyRestockContainer) { ! amount = QMIN(pItem->restock(), amount); ! } else if (layer == cBaseChar::BuyNoRestockContainer) { // Not enough of that item is left ! amount = QMIN(pItem->amount(), amount); ! } else { socket->sysMessage( tr( "Invalid item bought." ) ); socket->send( &clearBuy ); --- 121,135 ---- // First check: is the item on the vendor in the specified layer ! if( layer == cBaseChar::BuyRestockContainer ) ! { ! amount = wpMin<Q_UINT16>( pItem->restock(), amount ); ! } ! else if( layer == cBaseChar::BuyNoRestockContainer ) ! { // Not enough of that item is left ! amount = wpMin<Q_UINT16>( pItem->amount(), amount ); ! } ! else ! { socket->sysMessage( tr( "Invalid item bought." ) ); socket->send( &clearBuy ); *************** *** 330,334 **** { P_ITEM pItem = FindItemBySerial( iter->first ); ! Q_UINT16 amount = QMIN(pItem->amount(), iter->second); // If we can find something to stack with that is already in the vendors --- 335,339 ---- { P_ITEM pItem = FindItemBySerial( iter->first ); ! Q_UINT16 amount = wpMin<Q_UINT16>( pItem->amount(), iter->second ); // If we can find something to stack with that is already in the vendors Index: inlines.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/inlines.h,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** inlines.h 26 Oct 2004 18:37:54 -0000 1.32 --- inlines.h 3 Nov 2004 02:09:26 -0000 1.33 *************** *** 31,35 **** // library Includes #include <algorithm> - #include <math.h> #include <qglobal.h> #include <qstring.h> --- 31,34 ---- *************** *** 60,70 **** } ! inline int roundInt(double n) { ! double f = n - floor(n); ! if (f >= 0.50) { ! return (int)ceil(n); ! } else { ! return (int)floor(n); ! } } --- 59,83 ---- } ! template<typename T> ! inline T wpAbs( T a ) ! { ! return ( a >= 0 ? a : -a ); ! } ! ! template<typename T> ! inline T wpMin( T a, T b ) ! { ! return ( a > b ? b : a ); ! } ! ! template<typename T> ! inline T wpMax( T a, T b ) ! { ! return ( a < b ? b : a ); ! } ! ! inline int roundInt( double n ) ! { ! return static_cast<int>( n + 0.5 ); } --- NEW FILE: mapobjects.h --- /* * Wolfpack Emu (WP) * UO Server Emulation Program * * Copyright 2001-2004 by holders identified in AUTHORS.txt * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Palace - Suite 330, Boston, MA 02111-1307, USA. * * In addition to that license, if you are running this program or modified * versions of it on a public system you HAVE TO make the complete source of * the version used by you available or provide people with a location to * download it. * * Wolfpack Homepage: http://wpdev.sf.net/ */ #if !defined( __MAPOBJECTS_H__ ) #define __MAPOBJECTS_H__ #include "coord.h" #include "server.h" #include "singleton.h" #include <qptrvector.h> class Coord; class cItem; class cMulti; class cUObject; class cBaseChar; class MapObjects; class MapObjectsGrid; /*! Iterator returned by MapObjects::list*() operations. If you need to iterate many times over the same map region, you CAN reuse the iterator. All changes made to the map region will instantly affect the iterator. @warning Do not replicate iterator objects, as they have implicitly shared states. */ template<typename T = cUObject> class MapObjectsIterator { public: //! Constructs an invalid iterator. inline MapObjectsIterator() : mState( NULL ) {;} //! Copy constructor. inline MapObjectsIterator( const MapObjectsIterator &other ) : mState( other.mState ) { incrementRefCount(); } inline ~MapObjectsIterator() { decrementRefCount(); } //! Rewinds the iterator and returns the first element (NULL if empty). inline T * first(); //! Fetches the next element (NULL if there are no more elements). inline T * next(); //! Copy operator. MapObjectsIterator & operator=( const MapObjectsIterator &other ); private: friend class MapObjects; inline MapObjectsIterator( void *state ) : mState( state ) { incrementRefCount(); } inline void incrementRefCount(); inline void decrementRefCount(); private: void *mState; }; typedef MapObjectsIterator<cItem> MapItemsIterator; typedef MapObjectsIterator<cMulti> MapMultisIterator; typedef MapObjectsIterator<cBaseChar> MapCharsIterator; /*! Use MapObjects to efficiently locate objects within specific regions of the game maps. Supported lookups: - Objects at an exact coord. - Objects within a block (a cell of the internal grid structure). - Objects within a rectangle. - Objects within a circle (just as fast as the rectangle lookup). */ class MapObjects : public cComponent, public Singleton<MapObjects> { public: struct GridSet; public: MapObjects(); virtual ~MapObjects(); // Loads default maps void load(); /*! Adds a map, with the specified width and height, to the structure. @pre width and height MUST be multiples of 8. */ void addMap( UI08 map, UI16 width, UI16 height ); //! Adds an UObject to the structure. void add( cUObject *object ); /*! Updates an UObjects that's already in the structure. This is equivalent to removing&re-adding the UObject, but much faster. Must be called just before the object's position changes, with the new position. */ void update( cUObject *object, const Coord &newPos ); /*! This must be called whenever a player's online status changes (as defined by isOnline(), which takes lingering into consideration). If 'online' is true, the player's status is considered to have changed from offline to online; or if it's false, from online to offline. */ void updateOnlineStatus( cPlayer *player, bool online ); //! Removes an UObject from the structure. void remove( cUObject *object ); //! Whether a map is valid. bool validMap( UI08 map ) { return ( mMaps.size() > map && mMaps[map] ); } MapItemsIterator listItemsAtCoord( UI08 map, UI16 x, UI16 y ); MapItemsIterator listItemsInBlock( UI08 map, UI16 x, UI16 y ); MapItemsIterator listItemsInRect( UI08 map, UI16 x1, UI16 y1, UI16 x2, UI16 y2 ); MapItemsIterator listItemsInCircle( UI08 map, UI16 x, UI16 y, UI16 radius ); inline MapItemsIterator listItemsAtCoord( const Coord &pos ) { return listItemsAtCoord( pos.map, pos.x, pos.y ); } inline MapItemsIterator listItemsInBlock( const Coord &pos ) { return listItemsInBlock( pos.map, pos.x, pos.y ); } inline MapItemsIterator listItemsInRect( const Coord &p1, const Coord &p2 ) { return listItemsInRect( p1.map, p1.x, p1.y, p2.x, p2.y ); } inline MapItemsIterator listItemsInCircle( const Coord ¢er, UI16 radius ) { return listItemsInCircle( center.map, center.x, center.y, radius ); } MapMultisIterator listMultisAtCoord( UI08 map, UI16 x, UI16 y ); MapMultisIterator listMultisInBlock( UI08 map, UI16 x, UI16 y ); MapMultisIterator listMultisInRect( UI08 map, UI16 x1, UI16 y1, UI16 x2, UI16 y2 ); MapMultisIterator listMultisInCircle( UI08 map, UI16 x, UI16 y, UI16 radius ); inline MapMultisIterator listMultisAtCoord( const Coord &pos ) { return listMultisAtCoord( pos.map, pos.x, pos.y ); } inline MapMultisIterator listMultisInBlock( const Coord &pos ) { return listMultisInBlock( pos.map, pos.x, pos.y ); } inline MapMultisIterator listMultisInRect( const Coord &p1, const Coord &p2 ) { return listMultisInRect( p1.map, p1.x, p1.y, p2.x, p2.y ); } inline MapMultisIterator listMultisInCircle( const Coord ¢er, UI16 radius ) { return listMultisInCircle( center.map, center.x, center.y, radius ); } // Use 'offline' to list EITHER the online or offline characters MapCharsIterator listCharsAtCoord( UI08 map, UI16 x, UI16 y, bool offline = false ); MapCharsIterator listCharsInBlock( UI08 map, UI16 x, UI16 y, bool offline = false ); MapCharsIterator listCharsInRect( UI08 map, UI16 x1, UI16 y1, UI16 x2, UI16 y2, bool offline = false ); MapCharsIterator listCharsInCircle( UI08 map, UI16 x, UI16 y, UI16 radius, bool offline = false ); inline MapCharsIterator listCharsAtCoord( const Coord &pos, bool offline = false ) { return listCharsAtCoord( pos.map, pos.x, pos.y, offline ); } inline MapCharsIterator listCharsInBlock( const Coord &pos, bool offline = false ) { return listCharsInBlock( pos.map, pos.x, pos.y, offline ); } inline MapCharsIterator listCharsInRect( const Coord &p1, const Coord &p2, bool offline = false ) { return listCharsInRect( p1.map, p1.x, p1.y, p2.x, p2.y, offline ); } inline MapCharsIterator listCharsInCircle( const Coord ¢er, UI16 radius, bool offline = false ) { return listCharsInCircle( center.map, center.x, center.y, radius, offline ); } private: friend class MapObjectsIterator; static cUObject * firstIteration( void *state ); static cUObject * nextIteration( void *state ); static void releaseIterator( void *state ); private: QPtrVector<GridSet> mMaps; }; template<typename T> inline T * MapObjectsIterator<T>::first() { return reinterpret_cast<T *>( MapObjects::firstIteration( mState ) ); } template<typename T> inline T * MapObjectsIterator<T>::next() { return reinterpret_cast<T *>( MapObjects::nextIteration( mState ) ); } template<typename T> inline void MapObjectsIterator<T>::incrementRefCount() { // first UI16 in state holds our refcount if( mState ) ++( *reinterpret_cast<UI08 *>( mState ) ); } template<typename T> inline void MapObjectsIterator<T>::decrementRefCount() { // if refcount reaches zero, release the iterator if( mState && --( *reinterpret_cast<UI08 *>( mState ) ) == 0 ) MapObjects::releaseIterator( mState ); } template<typename T> MapObjectsIterator<T> & MapObjectsIterator<T>::operator=( const MapObjectsIterator &other ) { if( mState != other.mState ) { // increment other's refcount if( other.mState ) ++( *reinterpret_cast<UI08 *>( other.mState ) ); decrementRefCount(); mState = other.mState; } return *this; } #endif Index: tracking.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/tracking.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** tracking.cpp 19 Aug 2004 01:55:56 -0000 1.29 --- tracking.cpp 3 Nov 2004 02:09:28 -0000 1.30 *************** *** 32,36 **** #include "timers.h" ! #include "sectors.h" #include "gumps.h" #include "basechar.h" --- 32,36 ---- #include "timers.h" ! #include "mapobjects.h" #include "gumps.h" #include "basechar.h" *************** *** 114,120 **** // 3: Humans // 4: Players ! cCharSectorIterator* iter = SectorMaps::instance()->findChars( player->pos(), 18 ); ! ! for ( P_CHAR pChar = iter->first(); pChar; pChar = iter->next() ) { // Do the neccesary checks --- 114,119 ---- // 3: Humans // 4: Players ! MapCharsIterator iter = MapObjects::instance()->listCharsInCircle( player->pos(), 18 ); ! for ( P_CHAR pChar = iter.first(); pChar; pChar = iter.next() ) { // Do the neccesary checks *************** *** 171,176 **** ++pAmount; } - - delete iter; } }; --- 170,173 ---- Index: scriptmanager.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/scriptmanager.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** scriptmanager.h 2 Jun 2004 15:04:06 -0000 1.10 --- scriptmanager.h 3 Nov 2004 02:09:26 -0000 1.11 *************** *** 71,75 **** }; ! typedef SingletonHolder<cScriptManager> ScriptManager; #endif --- 71,75 ---- }; ! typedef Singleton<cScriptManager> ScriptManager; #endif Index: uotime.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/uotime.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** uotime.h 2 Jun 2004 15:04:07 -0000 1.3 --- uotime.h 3 Nov 2004 02:09:29 -0000 1.4 *************** *** 67,71 **** }; ! typedef SingletonHolder<cUoTime> UoTime; #endif --- 67,71 ---- }; ! typedef Singleton<cUoTime> UoTime; #endif Index: basechar.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/basechar.h,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** basechar.h 16 Oct 2004 19:42:55 -0000 1.92 --- basechar.h 3 Nov 2004 02:09:23 -0000 1.93 *************** *** 139,143 **** virtual bool canSeeChar( P_CHAR character ); virtual bool canSeeItem( P_ITEM item ); ! virtual void moveTo( const Coord_cl& pos, bool noremove = false ); /* --- 139,143 ---- virtual bool canSeeChar( P_CHAR character ); virtual bool canSeeItem( P_ITEM item ); ! virtual void moveTo( const Coord& pos, bool noremove = false ); /* *************** *** 149,158 **** Line of sight check for a static item */ ! bool lineOfSight( const Coord_cl& position, unsigned short id, bool debug = false ); /* Line of Sight check for a map tile */ ! bool lineOfSight( const Coord_cl& position, bool debug = false ); /* --- 149,158 ---- Line of sight check for a static item */ ! bool lineOfSight( const Coord& position, unsigned short id, bool debug = false ); /* Line of Sight check for a map tile */ ! bool lineOfSight( const Coord& position, bool debug = false ); /* *************** *** 285,289 **** virtual void turnTo( cUObject* object ); ! virtual void turnTo( const Coord_cl& pos ); void wear( P_ITEM ); bool isHuman() const; --- 285,289 ---- virtual void turnTo( cUObject* object ); ! virtual void turnTo( const Coord& pos ); void wear( P_ITEM ); bool isHuman() const; Index: coord.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/coord.cpp,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** coord.cpp 13 Oct 2004 14:45:20 -0000 1.64 --- coord.cpp 3 Nov 2004 02:09:25 -0000 1.65 *************** *** 30,34 **** #include "player.h" #include "network/network.h" ! #include "sectors.h" #include "items.h" #include "inlines.h" --- 30,34 ---- #include "player.h" #include "network/network.h" ! #include "mapobjects.h" #include "items.h" #include "inlines.h" *************** *** 46,53 **** #include <set> ! inline QValueList<Coord_cl> getPointList(const Coord_cl &origin, const Coord_cl &target) { // Create a list of coordinates we are going to "touch" when looking // from point a to point b ! QValueList<Coord_cl> pointList; int xDiff = target.x - origin.x; --- 46,53 ---- #include <set> ! inline QValueList<Coord> getPointList(const Coord &origin, const Coord &target) { // Create a list of coordinates we are going to "touch" when looking // from point a to point b ! QValueList<Coord> pointList; int xDiff = target.x - origin.x; *************** *** 76,80 **** double currentX = origin.x; ! Coord_cl pos = origin; while (isBetween(currentX, target.x, origin.x) && isBetween(currentY, target.y, origin.y) && isBetween(currentZ, target.z, origin.z)) { --- 76,80 ---- double currentX = origin.x; ! Coord pos = origin; while (isBetween(currentX, target.x, origin.x) && isBetween(currentY, target.y, origin.y) && isBetween(currentZ, target.z, origin.z)) { *************** *** 111,115 **** // Get blocking tiles at the given x,y,map coordinate ! void getBlockingTiles(const Coord_cl &pos, QValueList<stBlockingItem> &items) { stBlockingItem item; --- 111,116 ---- // Get blocking tiles at the given x,y,map coordinate ! void getBlockingTiles( const Coord &pos, QValueList<stBlockingItem> &items ) ! { stBlockingItem item; *************** *** 144,209 **** // Search for items at the given location ! cItemSectorIterator *ditems = SectorMaps::instance()->findItems(pos, 0); ! ! for (P_ITEM ditem = ditems->first(); ditem; ditem = ditems->next()) { // If the item is invisible or a multi, skip past it. ! if (ditem->isMulti()) { continue; - } ! tile_st tile = TileCache::instance()->getTile(ditem->id()); // Window and noshoot tiles block ! if (tile.flag2 & 0x30) { ! item.id = ditem->id(); ! item.bottom = ditem->pos().z; // Bridges are only half as high ! item.top = item.bottom + ((tile.flag2 & 0x04) ? (tile.height / 2) : tile.height); ! items.append(item); } } - delete ditems; - // Check for multis around the area ! cItemSectorIterator *multis = SectorMaps::instance()->findMultis(pos, BUILDRANGE); ! // Check if there is an intersecting item for this multi ! for (P_MULTI multi = (P_MULTI)multis->first(); multi; multi = (P_MULTI)multis->next()) { // Get all items for this multi ! MultiDefinition *data = MultiCache::instance()->getMulti(multi->id() - 0x4000); ! if (data) { QValueVector<multiItem_st> mitems = data->getEntries(); QValueVector<multiItem_st>::iterator it; ! for (it = mitems.begin(); it != mitems.end(); ++it) { multiItem_st mitem = *it; // Skip this multi tile if it's not at the position we need it to be ! if (!mitem.visible || multi->pos().x + mitem.x != pos.x || multi->pos().y + mitem.y != pos.y) { continue; } ! tile_st tile = TileCache::instance()->getTile(mitem.tile); ! // Has to be blocking ! if (tile.flag2 & 0x30) { ! item.bottom = mitem.z + multi->pos().z; ! item.top = item.bottom + ((tile.flag2 & 0x04) ? (tile.height / 2) : tile.height); item.id = mitem.tile; ! items.append(item); } } } } - - delete multis; } // Check for blocking tiles at the given position ! inline bool checkBlockingTiles(const QValueList<stBlockingItem> &items, const Coord_cl &pos, const Coord_cl &target) { // Iterate trough all blocking tiles QValueList<stBlockingItem>::const_iterator it; ! for (it = items.begin(); it != items.end(); ++it) { stBlockingItem item = *it; --- 145,213 ---- // Search for items at the given location ! MapItemsIterator itemIter = MapObjects::instance()->listItemsAtCoord( pos ); ! for( P_ITEM pItem = itemIter.first(); pItem; pItem = itemIter.next() ) ! { // If the item is invisible or a multi, skip past it. ! if( pItem->isMulti() ) continue; ! tile_st tile = TileCache::instance()->getTile( pItem->id() ); // Window and noshoot tiles block ! if( tile.flag2 & 0x30 ) ! { ! item.id = pItem->id(); ! item.bottom = pItem->pos().z; // Bridges are only half as high ! item.top = item.bottom + ( ( tile.flag2 & 0x04 ) ? ( tile.height / 2 ) : tile.height ); ! items.append( item ); } } // Check for multis around the area ! MapMultisIterator multis = MapObjects::instance()->listMultisInCircle( pos, BUILDRANGE ); ! // Check if there is an intersecting item for this multi ! for( P_MULTI pMulti = multis.first(); pMulti; pMulti = multis.next() ) ! { // Get all items for this multi ! MultiDefinition *data = MultiCache::instance()->getMulti( pMulti->id() - 0x4000 ); ! if( data ) ! { QValueVector<multiItem_st> mitems = data->getEntries(); QValueVector<multiItem_st>::iterator it; ! for( it = mitems.begin(); it != mitems.end(); ++it ) ! { multiItem_st mitem = *it; // Skip this multi tile if it's not at the position we need it to be ! if( !mitem.visible || pMulti->pos().x + mitem.x != pos.x || pMulti->pos().y + mitem.y != pos.y ) ! { continue; } ! tile_st tile = TileCache::instance()->getTile( mitem.tile ); ! // Has to be blocking ! if( tile.flag2 & 0x30 ) ! { ! item.bottom = mitem.z + pMulti->pos().z; ! item.top = item.bottom + ( ( tile.flag2 & 0x04 ) ? ( tile.height / 2 ) : tile.height ); item.id = mitem.tile; ! items.append( item ); } } } } } // Check for blocking tiles at the given position ! inline bool checkBlockingTiles( const QValueList<stBlockingItem> &items, const Coord &pos, const Coord &target ) ! { // Iterate trough all blocking tiles QValueList<stBlockingItem>::const_iterator it; ! for (it = items.begin(); it != items.end(); ++it) ! { stBlockingItem item = *it; *************** *** 227,231 **** // Check the line of sight from a source to a target coordinate. ! bool Coord_cl::lineOfSight(const Coord_cl &target, bool debug) const { // If the target is out of range, save cpu time by not calculating the // line of sight --- 231,235 ---- // Check the line of sight from a source to a target coordinate. ! bool Coord::lineOfSight(const Coord &target, bool debug) const { // If the target is out of range, save cpu time by not calculating the // line of sight *************** *** 239,250 **** } ! QValueList<Coord_cl> pointList = getPointList(*this, target); int lastX = -1, lastY = -1; QValueList<stBlockingItem> blockingItems; ! QValueList<Coord_cl>::const_iterator it; for (it = pointList.begin(); it != pointList.end(); ++it) { ! Coord_cl point = *it; // Get a fresh tile-list --- 243,254 ---- } ! QValueList<Coord> pointList = getPointList(*this, target); int lastX = -1, lastY = -1; QValueList<stBlockingItem> blockingItems; ! QValueList<Coord>::const_iterator it; for (it = pointList.begin(); it != pointList.end(); ++it) { ! Coord point = *it; // Get a fresh tile-list *************** *** 273,289 **** } ! Coord_cl Coord_cl::null( 0xFFFF, 0xFFFF, 0xFF, 0xFF ); ! Coord_cl::Coord_cl( void ) { x = y = z = map = 0; } ! Coord_cl::Coord_cl( const Coord_cl& clCoord ) { ( *this ) = clCoord; } ! Coord_cl::Coord_cl( UI16 uiX, UI16 uiY, SI08 siZ, UI08 uiMap, UI08 ) { x = uiX; --- 277,293 ---- } ! Coord Coord::null( 0xFFFF, 0xFFFF, 0xFF, 0xFF ); ! Coord::Coord( void ) { x = y = z = map = 0; } ! Coord::Coord( const Coord& clCoord ) { ( *this ) = clCoord; } ! Coord::Coord( UI16 uiX, UI16 uiY, SI08 siZ, UI08 uiMap, UI08 ) { x = uiX; *************** *** 303,307 **** * @return UI32 : distance result */ ! unsigned int Coord_cl::distance( const Coord_cl& src ) const { UI32 uiResult = ~0U; // Initialize with *infinite* --- 307,311 ---- * @return UI32 : distance result */ ! unsigned int Coord::distance( const Coord& src ) const { UI32 uiResult = ~0U; // Initialize with *infinite* *************** *** 315,319 **** } ! UI32 Coord_cl::distance( const Coord_cl& a, const Coord_cl& b ) { return a.distance( b ); --- 319,323 ---- } ! UI32 Coord::distance( const Coord& a, const Coord& b ) { return a.distance( b ); *************** *** 321,325 **** // Operators ! Coord_cl& Coord_cl::operator=( const Coord_cl& clCoord ) { x = clCoord.x; --- 325,329 ---- // Operators ! Coord& Coord::operator=( const Coord& clCoord ) { x = clCoord.x; *************** *** 330,354 **** } ! bool Coord_cl::operator==( const Coord_cl& src ) const { return ( x == src.x && y == src.y && z == src.z && map == src.map ); } ! bool Coord_cl::operator!=( const Coord_cl& src ) const { return !( x == src.x && y == src.y && z == src.z && map == src.map ); } ! Coord_cl Coord_cl::operator+( const Coord_cl& src ) const { ! return Coord_cl( this->x + src.x, this->y + src.y, this->z + src.z, this->map ); } ! Coord_cl Coord_cl::operator-( const Coord_cl& src ) const { ! return Coord_cl( this->x - src.x, this->y - src.y, this->z - src.z, this->map ); } ! void Coord_cl::effect( Q_UINT16 id, Q_UINT8 speed, Q_UINT8 duration, Q_UINT16 hue, Q_UINT16 renderMode ) const { cUOTxEffect effect; --- 334,358 ---- } ! bool Coord::operator==( const Coord& src ) const { return ( x == src.x && y == src.y && z == src.z && map == src.map ); } ! bool Coord::operator!=( const Coord& src ) const { return !( x == src.x && y == src.y && z == src.z && map == src.map ); } ! Coord Coord::operator+( const Coord& src ) const { ! return Coord( this->x + src.x, this->y + src.y, this->z + src.z, this->map ); } ! Coord Coord::operator-( const Coord& src ) const { ! return Coord( this->x - src.x, this->y - src.y, this->z - src.z, this->map ); } ! void Coord::effect( Q_UINT16 id, Q_UINT8 speed, Q_UINT8 duration, Q_UINT16 hue, Q_UINT16 renderMode ) const { cUOTxEffect effect; *************** *** 370,374 **** // Calculates the direction from one location to another ! unsigned int Coord_cl::direction( const Coord_cl& dest ) const { unsigned int dir; --- 374,378 ---- // Calculates the direction from one location to another ! unsigned int Coord::direction( const Coord& dest ) const { unsigned int dir; *************** *** 400,411 **** } ! Coord_cl Coord_cl::losCharPoint(bool eye) const { ! Coord_cl result = *this; result.z += (eye ? 15 : 10); return result; } ! Coord_cl Coord_cl::losItemPoint(unsigned short id) const { ! Coord_cl result = *this; tile_st tile = TileCache::instance()->getTile(id); --- 404,415 ---- } ! Coord Coord::losCharPoint(bool eye) const { ! Coord result = *this; result.z += (eye ? 15 : 10); return result; } ! Coord Coord::losItemPoint(unsigned short id) const { ! Coord result = *this; tile_st tile = TileCache::instance()->getTile(id); *************** *** 415,420 **** } ! Coord_cl Coord_cl::losMapPoint() const { ! Coord_cl result = *this; int bottom, top; --- 419,424 ---- } ! Coord Coord::losMapPoint() const { ! Coord result = *this; int bottom, top; *************** *** 430,434 **** } ! Coord_cl Coord_cl::losTargetPoint(cUORxTarget *target, unsigned char map) { SERIAL serial = target->serial(); P_ITEM pItem = World::instance()->findItem(serial); --- 434,438 ---- } ! Coord Coord::losTargetPoint(cUORxTarget *target, unsigned char map) { SERIAL serial = target->serial(); P_ITEM pItem = World::instance()->findItem(serial); *************** *** 446,450 **** return pChar->pos().losCharPoint(); } else { ! return Coord_cl(target->x(), target->y(), target->z(), map); } } --- 450,454 ---- return pChar->pos().losCharPoint(); } else { ! return Coord(target->x(), target->y(), target->z(), map); } } Index: player.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/player.h,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** player.h 15 Oct 2004 00:53:10 -0000 1.61 --- player.h 3 Nov 2004 02:09:26 -0000 1.62 *************** *** 76,79 **** --- 76,80 ---- void save(); bool del(); + void postload( unsigned int version ); void load( cBufferedReader& reader, unsigned int version ); void save( cBufferedWriter& writer, unsigned int version ); *************** *** 121,129 **** unsigned int damage( eDamageType type, unsigned int amount, cUObject* source = 0 ); // Wrapper events ! virtual bool onLogin( void ); // The character enters the world ! virtual bool onLogout( void ); // The character enters the world ! virtual bool onHelp( void ); // The character wants help ! virtual bool onChat( void ); // The character wants to chat virtual bool onCastSpell( unsigned int spell ); void poll( unsigned int time, unsigned int events ); --- 122,137 ---- unsigned int damage( eDamageType type, unsigned int amount, cUObject* source = 0 ); + //! Returns true if there's a client (socket) attached to the character. + bool isConnected(); + + //! Returns true if the char is present in the world (may have disconnected, but be lingering). + bool isOnline(); + // Wrapper events ! virtual bool onLogin(); // The character enters the world ! virtual bool onDisconnect(); // The socket has disconnected ! virtual bool onLogout(); // The character exits the world ! virtual bool onHelp(); // The character wants help ! virtual bool onChat(); // The character wants to chat virtual bool onCastSpell( unsigned int spell ); void poll( unsigned int time, unsigned int events ); *************** *** 201,205 **** bool canSeeChar( P_CHAR character ); bool canSeeItem( P_ITEM item ); ! virtual void moveTo( const Coord_cl& pos, bool noremove = false ); // cPythonScriptable inherited methods --- 209,213 ---- bool canSeeChar( P_CHAR character ); bool canSeeItem( P_ITEM item ); ! virtual void moveTo( const Coord& pos, bool noremove = false ); // cPythonScriptable inherited methods *************** *** 524,526 **** --- 532,544 ---- } + inline bool cPlayer::isConnected() + { + return socket_ != 0; + } + + inline bool cPlayer::isOnline() + { + return socket_ != 0 || logoutTime_ != 0; + } + #endif /* CPLAYER_H_HEADER_INCLUDED */ Index: coord.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/coord.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** coord.h 21 Oct 2004 12:11:10 -0000 1.23 --- coord.h 3 Nov 2004 02:09:25 -0000 1.24 *************** *** 35,61 **** class cUORxTarget; ! class WPEXPORT Coord_cl { public: ! Coord_cl( void ); ! Coord_cl( const Coord_cl& clCoord ); ! Coord_cl( UI16, UI16, SI08 = 0, UI08 uiMap = 0, UI08 uiPlane = 0 ); // Operators ! Coord_cl& operator=( const Coord_cl& clCoord ); ! bool operator==( const Coord_cl& ) const; ! bool operator!=( const Coord_cl& ) const; ! Coord_cl operator+( const Coord_cl& src ) const; ! Coord_cl operator-( const Coord_cl& src ) const; ! unsigned int distance( const Coord_cl& src ) const; ! unsigned int direction( const Coord_cl& dest ) const; ! bool lineOfSight(const Coord_cl &dest, bool debug = false) const; // Utility functions for getting correct LOS points ! Coord_cl losCharPoint(bool eye = false) const; ! Coord_cl losItemPoint(unsigned short id) const; ! Coord_cl losMapPoint() const; ! static Coord_cl losTargetPoint(cUORxTarget *target, unsigned char map); ! static UI32 distance( const Coord_cl& a, const Coord_cl& b ); /*! --- 35,61 ---- class cUORxTarget; ! class WPEXPORT Coord { public: ! Coord( void ); ! Coord( const Coord& clCoord ); ! Coord( UI16, UI16, SI08 = 0, UI08 uiMap = 0, UI08 uiPlane = 0 ); // Operators ! Coord& operator=( const Coord& clCoord ); ! bool operator==( const Coord& ) const; ! bool operator!=( const Coord& ) const; ! Coord operator+( const Coord& src ) const; ! Coord operator-( const Coord& src ) const; ! unsigned int distance( const Coord& src ) const; ! unsigned int direction( const Coord& dest ) const; ! bool lineOfSight(const Coord &dest, bool debug = false) const; // Utility functions for getting correct LOS points ! Coord losCharPoint(bool eye = false) const; ! Coord losItemPoint(unsigned short id) const; ! Coord losMapPoint() const; ! static Coord losTargetPoint(cUORxTarget *target, unsigned char map); ! static UI32 distance( const Coord& a, const Coord& b ); /*! *************** *** 64,68 **** void effect( UI16 id, UI08 speed = 10, UI08 duration = 5, UI16 hue = 0, UI16 renderMode = 0 ) const; ! static Coord_cl null; public: --- 64,68 ---- void effect( UI16 id, UI08 speed = 10, UI08 duration = 5, UI16 hue = 0, UI16 renderMode = 0 ) const; ! static Coord null; public: Index: combat.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/combat.cpp,v retrieving revision 1.174 retrieving revision 1.175 diff -C2 -d -r1.174 -r1.175 *** combat.cpp 29 Aug 2004 15:35:03 -0000 1.174 --- combat.cpp 3 Nov 2004 02:09:23 -0000 1.175 *************** *** 72,76 **** } ! void cCombat::spawnGuard( P_CHAR pOffender, P_CHAR pCaller, const Coord_cl& pos ) { if ( !pOffender || !pCaller ) --- 72,76 ---- } ! void cCombat::spawnGuard( P_CHAR pOffender, P_CHAR pCaller, const Coord& pos ) { if ( !pOffender || !pCaller ) --- sectors.h DELETED --- Index: definitions.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/definitions.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** definitions.h 11 Oct 2004 07:58:00 -0000 1.6 --- definitions.h 3 Nov 2004 02:09:25 -0000 1.7 *************** *** 154,158 **** }; ! typedef SingletonHolder<cDefinitions> Definitions; #endif // __WPDEFMANAGER_H__ --- 154,158 ---- }; ! typedef Singleton<cDefinitions> Definitions; #endif // __WPDEFMANAGER_H__ Index: wolfpack.vcproj =================================================================== RCS file: /cvsroot/wpdev/wolfpack/wolfpack.vcproj,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** wolfpack.vcproj 2 Nov 2004 20:45:44 -0000 1.54 --- wolfpack.vcproj 3 Nov 2004 02:09:29 -0000 1.55 *************** *** 391,394 **** --- 391,400 ---- </File> <File + RelativePath=".\mapobjects.cpp"> + </File> + <File + RelativePath=".\mapobjects.h"> + </File> + <File RelativePath=".\md5.cpp"> </File> *************** *** 484,493 **** </File> <File - RelativePath=".\sectors.cpp"> - </File> - <File - RelativePath=".\sectors.h"> - </File> - <File RelativePath=".\server.cpp"> </File> --- 490,493 ---- Index: dragdrop.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/dragdrop.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** dragdrop.h 2 Jun 2004 15:04:05 -0000 1.24 --- dragdrop.h 3 Nov 2004 02:09:26 -0000 1.25 *************** *** 43,49 **** // Sub-drop Functions ! void dropOnItem( cUOSocket* socket, P_ITEM pItem, P_ITEM pCont, const Coord_cl& dropPos ); void dropOnChar( cUOSocket* socket, P_ITEM pItem, P_CHAR pOtherChar ); ! void dropOnGround( cUOSocket* socket, P_ITEM pItem, const Coord_cl& pos ); // Drop-on-char subfunctions --- 43,49 ---- // Sub-drop Functions ! void dropOnItem( cUOSocket* socket, P_ITEM pItem, P_ITEM pCont, const Coord& dropPos ); void dropOnChar( cUOSocket* socket, P_ITEM pItem, P_CHAR pOtherChar ); ! void dropOnGround( cUOSocket* socket, P_ITEM pItem, const Coord& pos ); // Drop-on-char subfunctions Index: combat.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/combat.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** combat.h 2 Jun 2004 15:04:04 -0000 1.13 --- combat.h 3 Nov 2004 02:09:24 -0000 1.14 *************** *** 33,37 **** #include <qptrlist.h> ! class Coord_cl; class cUOSocket; --- 33,37 ---- #include <qptrlist.h> ! class Coord; class cUOSocket; *************** *** 174,181 **** void playGetHitSoundEffect( P_CHAR pChar ); void playGetHitAnimation( P_CHAR pChar ); ! void spawnGuard( P_CHAR pOffender, P_CHAR pCaller, const Coord_cl& pos ); }; ! typedef SingletonHolder<cCombat> Combat; #endif // __COMBAT_H__ --- 174,181 ---- void playGetHitSoundEffect( P_CHAR pChar ); void playGetHitAnimation( P_CHAR pChar ); ! void spawnGuard( P_CHAR pOffender, P_CHAR pCaller, const Coord& pos ); }; ! typedef Singleton<cCombat> Combat; #endif // __COMBAT_H__ Index: walking.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/walking.cpp,v retrieving revision 1.158 retrieving revision 1.159 diff -C2 -d -r1.158 -r1.159 *** walking.cpp 27 Oct 2004 16:19:42 -0000 1.158 --- walking.cpp 3 Nov 2004 02:09:29 -0000 1.159 *************** *** 31,35 **** // Wolfpack Includes #include "walking.h" ! #include "sectors.h" #include "serverconfig.h" #include "network/network.h" --- 31,35 ---- // Wolfpack Includes #include "walking.h" ! #include "mapobjects.h" #include "serverconfig.h" #include "network/network.h" *************** *** 155,159 **** // The highest items will be @ the beginning // While walking we always will try the highest first. ! vector< stBlockItem > getBlockingItems( P_CHAR pChar, const Coord_cl& pos ) { vector<stBlockItem> blockList; --- 155,159 ---- // The highest items will be @ the beginning // While walking we always will try the highest first. ! vector< stBlockItem > getBlockingItems( P_CHAR pChar, const Coord& pos ) { vector<stBlockItem> blockList; *************** *** 215,233 **** } - // We are only interested in items at pos // todo: we could impliment blocking for items on the adjacent sides // during a diagonal move here, but this has yet to be decided. ! RegionIterator4Items iIter( pos, 0 ); ! ! P_ITEM pItem; ! for ( iIter.Begin(); !iIter.atEnd(); iIter++ ) { - pItem = iIter.GetData(); - - if ( !pItem ) - continue; - if ( pChar && pChar->isDead() ) { --- 215,225 ---- } // We are only interested in items at pos // todo: we could impliment blocking for items on the adjacent sides // during a diagonal move here, but this has yet to be decided. ! MapItemsIterator iIter = MapObjects::instance()->listItemsAtCoord( pos ); ! for ( P_ITEM pItem = iIter.first(); pItem; pItem = iIter.next() ) { if ( pChar && pChar->isDead() ) { *************** *** 239,243 **** } - tile_st tTile = TileCache::instance()->getTile( pItem->id() ); --- 231,234 ---- *************** *** 262,276 **** // deal with the multis now, or not. ! cItemSectorIterator* iter = SectorMaps::instance()->findMultis( pos, 18 ); // 18 has been tested with castle sides and corners... ! for ( pItem = iter->first(); pItem; pItem = iter->next() ) { ! MultiDefinition* def = MultiCache::instance()->getMulti( pItem->id() - 0x4000 ); if ( !def ) continue; QValueVector<multiItem_st> multi = def->getEntries(); ! unsigned int j; ! for ( j = 0; j < multi.size(); ++j ) { ! if ( multi[j].visible && ( pItem->pos().x + multi[j].x == pos.x ) && ( pItem->pos().y + multi[j].y == pos.y ) ) { tile_st tTile = TileCache::instance()->getTile( multi[j].tile ); --- 253,269 ---- // deal with the multis now, or not. ! // 18 has been tested with castle sides and corners... ! MapMultisIterator iter = MapObjects::instance()->listMultisInCircle( pos, 18 ); ! for( cMulti *pMulti = iter.first(); pMulti; pMulti = iter.next() ) { ! MultiDefinition* def = MultiCache::instance()->getMulti( pMulti->id() - 0x4000 ); if ( !def ) continue; + QValueVector<multiItem_st> multi = def->getEntries(); ! ! for( unsigned int j = 0; j < multi.size(); ++j ) { ! if ( multi[j].visible && ( pMulti->pos().x + multi[j].x == pos.x ) && ( pMulti->pos().y + multi[j].y == pos.y ) ) { tile_st tTile = TileCache::instance()->getTile( multi[j].tile ); *************** *** 280,289 **** stBlockItem blockItem; blockItem.height = (tTile.flag2 & 0x04) ? (tTile.height / 2) : tTile.height; ! blockItem.z = pItem->pos().z + multi[j].z; if ( ( tTile.flag2 & 0x02 ) && !( tTile.flag1 & 0x40 ) ) blockItem.walkable = true; else ! blockItem.walkable = checkWalkable( pChar, pItem->id() ); blockList.push_back( blockItem ); --- 273,282 ---- stBlockItem blockItem; blockItem.height = (tTile.flag2 & 0x04) ? (tTile.height / 2) : tTile.height; ! blockItem.z = pMulti->pos().z + multi[j].z; if ( ( tTile.flag2 & 0x02 ) && !( tTile.flag1 & 0x40 ) ) blockItem.walkable = true; else ! blockItem.walkable = checkWalkable( pChar, pMulti->id() ); blockList.push_back( blockItem ); *************** *** 293,302 **** continue; } - - delete iter; - // Now we need to evaluate dynamic items [...] (later) ?? - sort_heap( blockList.begin(), blockList.end(), compareTiles() ); --- 286,291 ---- *************** *** 307,311 **** // May a character walk here ? // If yes we auto. set the new z value for pos ! bool mayWalk( P_CHAR pChar, Coord_cl& pos ) { // Go trough the array top-to-bottom and check --- 296,300 ---- // May a character walk here ? // If yes we auto. set the new z value for pos ! bool mayWalk( P_CHAR pChar, Coord& pos ) { // Go trough the array top-to-bottom and check *************** *** 442,446 **** bool handleItemCollision( P_CHAR pChar, P_ITEM pItem ) { ! Coord_cl dPos = pChar->pos(); if ( pItem->onCollide( pChar ) ) --- 431,435 ---- bool handleItemCollision( P_CHAR pChar, P_ITEM pItem ) { ! Coord dPos = pChar->pos(); if ( pItem->onCollide( pChar ) ) *************** *** 451,464 **** /*! ! Sends items which came in range and ! handles collisions with teleporters or damaging items. */ ! void handleItems( P_CHAR pChar, const Coord_cl& oldpos ) { P_PLAYER player = dynamic_cast<P_PLAYER>( pChar ); ! cItemSectorIterator* iter = SectorMaps::instance()->findItems( pChar->pos(), BUILDRANGE ); ! for ( cItem*pItem = iter->first(); pItem; pItem = iter->next() ) { // Check for item collisions here. --- 440,452 ---- /*! ! Sends items which came in range and handles collisions with teleporters or damaging items. */ ! void handleItems( P_CHAR pChar, const Coord& oldpos ) { P_PLAYER player = dynamic_cast<P_PLAYER>( pChar ); ! MapItemsIterator iter = MapObjects::instance()->listItemsInCircle( pChar->pos(), VISRANGE ); ! for( P_ITEM pItem = iter.first(); pItem; pItem = iter.next() ) { // Check for item collisions here. *************** *** 475,497 **** // If we are a connected player then send new items ! if ( player && player->socket() ) { UI32 oldDist = oldpos.distance( pItem->pos() ); ! UI32 newDist = pChar->pos().distance( pItem->pos() ); ! ! // Was out of range before and now is in range ! if ( pItem->isMulti() ) { ! if ( ( oldDist >= BUILDRANGE ) && ( newDist < BUILDRANGE ) ) ! { ! pItem->update( player->socket() ); ! } } ! else { ! if ( ( oldDist >= player->visualRange() ) && ( newDist < player->visualRange() ) ) ! { ! pItem->update( player->socket() ); ! } } } --- 463,498 ---- // If we are a connected player then send new items ! if( player && player->socket() ) { UI32 oldDist = oldpos.distance( pItem->pos() ); ! if( oldDist >= player->visualRange() ) { ! // was out of range before and now is in range ! pItem->update( player->socket() ); } ! } ! } ! } ! ! /*! ! Sends multis which came in range and handles collisions with them. ! */ ! void handleMultis( P_CHAR pChar, const Coord& oldpos ) ! { ! P_PLAYER player = dynamic_cast<P_PLAYER>( pChar ); ! ! MapMultisIterator multis = MapObjects::instance()->listMultisInCircle( pChar->pos(), BUILDRANGE ); ! for( P_MULTI multi = multis.first(); multi; multi = multis.next() ) ! { ! // TODO: handle multi collisions here. ! ! // If we are a connected player then send new multis ! if( player && player->socket() ) ! { ! UI32 oldDist = oldpos.distance( multi->pos() ); ! if( oldDist >= BUILDRANGE ) { ! // was out of range before and now is in range ! multi->update( player->socket() ); } } *************** *** 526,530 **** // save our original location before we even think about moving ! const Coord_cl oldpos( pChar->pos() ); // If the Direction we're moving to is different from our current direction --- 527,531 ---- // save our original location before we even think about moving ! const Coord oldpos( pChar->pos() ); // If the Direction we're moving to is different from our current direction *************** *** 543,547 **** { // Note: Do NOT use the copy constructor as it'll create a reference ! Coord_cl newCoord = calcCoordFromDir( dir, pChar->pos() ); // Check if the stamina parameters --- 544,548 ---- { // Note: Do NOT use the copy constructor as it'll create a reference ! Coord newCoord = calcCoordFromDir( dir, pChar->pos() ); // Check if the stamina parameters *************** *** 593,614 **** pChar->setDirection( dir ); ! RegionIterator4Chars ri( pChar->pos(), 18, true ); ! for ( ri.Begin(); !ri.atEnd(); ri++ ) { ! P_CHAR observer = ri.GetData(); ! ! if ( observer == pChar ) ! { continue; - } unsigned int distance = observer->pos().distance( oldpos ); // If we are a player, send us new characters ! if ( player && player->socket() ) { ! if ( distance > player->visualRange() ) { ! player->socket()->sendChar( observer ); // We were previously out of range. } } --- 594,612 ---- pChar->setDirection( dir ); ! MapCharsIterator ri = MapObjects::instance()->listCharsInCircle( pChar->pos(), VISRANGE ); ! for( P_CHAR observer = ri.first(); observer; observer = ri.next() ) { ! if( observer == pChar ) continue; unsigned int distance = observer->pos().distance( oldpos ); // If we are a player, send us new characters ! if( player && player->socket() ) { ! if ( distance >= player->visualRange() ) { ! // an observer was previously out of range. ! player->socket()->sendChar( observer ); } } *************** *** 617,623 **** P_PLAYER otherplayer = dynamic_cast<P_PLAYER>( observer ); ! if ( otherplayer && otherplayer->socket() ) { ! if ( distance > otherplayer->visualRange() ) { otherplayer->socket()->sendChar( pChar ); // Previously we were out of range --- 615,621 ---- P_PLAYER otherplayer = dynamic_cast<P_PLAYER>( observer ); ! if( otherplayer && otherplayer->socket() ) { ! if( distance > otherplayer->visualRange() ) { otherplayer->socket()->sendChar( pChar ); // Previously we were out of range *************** *** 639,642 **** --- 637,641 ---- { handleItems( pChar, oldpos ); + handleMultis( pChar, oldpos ); handleTeleporters( pChar, oldpos ); } *************** *** 645,671 **** } ! bool cMovement::CheckForCharacterAtXYZ( P_CHAR pc, const Coord_cl& pos ) { ! // again this seems to me like we are doing too much work. ! // why should we get all chars in the region using default (18), ! // and then loop through them ignoring all those not at exactly the spot we are going (now) on? ! // why not just get those on the one spot we care about anyways? ! ! RegionIterator4Chars ri( pos, 0 ); ! for ( ri.Begin(); !ri.atEnd(); ri++ ) { ! P_CHAR pc_i = ri.GetData(); ! if ( pc_i != NULL ) { ! if ( pc_i != pc && !pc_i->isHidden() && !pc_i->isInvisible() ) { ! // x=x,y=y, and distance btw z's <= MAX STEP ! if ( abs( pc_i->pos().z - pos.z ) <= P_M_MAX_Z_CLIMB ) ! { ! return true; ! } } } } return false; } --- 644,662 ---- } ! bool cMovement::CheckForCharacterAtXYZ( P_CHAR pc, const Coord& pos ) { ! MapCharsIterator ri = MapObjects::instance()->listCharsAtCoord( pos ); ! for( P_CHAR pChar = ri.first(); pChar; pChar = ri.next() ) { ! if( pChar != pc && !pChar->isHidden() && !pChar->isInvisible() ) { ! // x=x,y=y, and distance btw z's <= MAX STEP ! if( abs( pChar->pos().z - pos.z ) <= P_M_MAX_Z_CLIMB ) { ! return true; } } } + return false; } *************** *** 707,711 **** } ! void cMovement::handleTeleporters( P_CHAR pc, const Coord_cl& oldpos ) { cTerritory* territory = pc->region(); --- 698,702 ---- } ! void cMovement::handleTeleporters... [truncated message content] |
From: HellRaider <hel...@us...> - 2004-11-03 02:10:12
|
Update of /cvsroot/wpdev/wolfpack/ai In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29663/ai Modified Files: ai.cpp ai.h ai_animals.cpp ai_humans.cpp ai_mage.cpp ai_monsters.cpp Log Message: New sectors code and more. A changelog will be sent to the mailing list. Index: ai_animals.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/ai/ai_animals.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ai_animals.cpp 16 Oct 2004 04:53:23 -0000 1.18 --- ai_animals.cpp 3 Nov 2004 02:09:30 -0000 1.19 *************** *** 31,36 **** #include "../serverconfig.h" - #include "../sectors.h" #include "../basics.h" #include "../targetrequests.h" --- 31,36 ---- #include "../serverconfig.h" #include "../basics.h" + #include "../mapobjects.h" #include "../targetrequests.h" *************** *** 78,85 **** return 0.0f; ! RegionIterator4Chars ri( m_npc->pos(), Config::instance()->animalWildFleeRange() ); ! for ( ri.Begin(); !ri.atEnd(); ri++ ) { ! P_PLAYER pPlayer = dynamic_cast<P_PLAYER>( ri.GetData() ); if ( pPlayer && !pPlayer->free && !pPlayer->isGMorCounselor() && !pPlayer->isHidden() && !pPlayer->isInvisible() ) { --- 78,85 ---- return 0.0f; ! MapCharsIterator ri = MapObjects::instance()->listCharsInCircle( m_npc->pos(), Config::instance()->animalWildFleeRange() ); ! for ( P_CHAR pChar = ri.first(); pChar; pChar = ri.next() ) { ! P_PLAYER pPlayer = dynamic_cast<P_PLAYER>( pChar ); if ( pPlayer && !pPlayer->free && !pPlayer->isGMorCounselor() && !pPlayer->isHidden() && !pPlayer->isInvisible() ) { *************** *** 109,117 **** return 1.0f; - RegionIterator4Chars ri( m_npc->pos(), Config::instance()->animalWildFleeRange() ); bool found = false; ! for ( ri.Begin(); !ri.atEnd(); ri++ ) { ! P_PLAYER pPlayer = dynamic_cast<P_PLAYER>( ri.GetData() ); if ( pPlayer && !pPlayer->free && !pPlayer->isGMorCounselor() && !pPlayer->isHidden() && !pPlayer->isInvisible() ) found = true; --- 109,117 ---- return 1.0f; bool found = false; ! MapCharsIterator ri = MapObjects::instance()->listCharsInCircle( m_npc->pos(), Config::instance()->animalWildFleeRange() ); ! for ( P_CHAR pChar = ri.first(); pChar; pChar = ri.next() ) { ! P_PLAYER pPlayer = dynamic_cast<P_PLAYER>( pChar ); if ( pPlayer && !pPlayer->free && !pPlayer->isGMorCounselor() && !pPlayer->isHidden() && !pPlayer->isInvisible() ) found = true; Index: ai_humans.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/ai/ai_humans.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** ai_humans.cpp 2 Nov 2004 20:45:40 -0000 1.28 --- ai_humans.cpp 3 Nov 2004 02:09:30 -0000 1.29 *************** *** 37,44 **** #include "../console.h" - #include "../sectors.h" #include "../world.h" - #include "../inlines.h" #include "../basics.h" // library includes --- 37,44 ---- #include "../console.h" #include "../world.h" #include "../basics.h" + #include "../inlines.h" + #include "../mapobjects.h" // library includes *************** *** 209,213 **** //pPet->free = true; - MapObjects::instance()->remove( pPet ); pPet->setStablemasterSerial( this->m_npc->serial() ); pPet->setOwner(0); // Remove ownership from this player since it's stabled --- 209,212 ---- *************** *** 382,389 **** { // Get a criminal or murderer in range to attack it ! RegionIterator4Chars ri( m_npc->pos(), VISRANGE ); ! for ( ri.Begin(); !ri.atEnd(); ri++ ) { - P_CHAR pChar = ri.GetData(); if ( pChar && !pChar->free && pChar != m_npc && !pChar->isInvulnerable() && !pChar->isHidden() && !pChar->isInvisible() && !pChar->isDead() ) { --- 381,387 ---- { // Get a criminal or murderer in range to attack it ! MapCharsIterator ri = MapObjects::instance()->listCharsInCircle( m_npc->pos(), VISRANGE ); ! for ( P_CHAR pChar = ri.first(); pChar; pChar = ri.next() ) { if ( pChar && !pChar->free && pChar != m_npc && !pChar->isInvulnerable() && !pChar->isHidden() && !pChar->isInvisible() && !pChar->isDead() ) { Index: ai_monsters.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/ai/ai_monsters.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** ai_monsters.cpp 27 Oct 2004 14:07:08 -0000 1.29 --- ai_monsters.cpp 3 Nov 2004 02:09:30 -0000 1.30 *************** *** 30,35 **** #include "../npc.h" #include "../factory.h" - #include "../sectors.h" #include "../player.h" #include "../serverconfig.h" #include "../basics.h" --- 30,35 ---- #include "../npc.h" #include "../factory.h" #include "../player.h" + #include "../mapobjects.h" #include "../serverconfig.h" #include "../basics.h" *************** *** 118,126 **** // If we're not tamed, we attack other players as well. if (!npc->isTamed()) { ! RegionIterator4Chars ri(npc->pos(), VISRANGE); ! for ( ri.Begin(); !ri.atEnd(); ri++ ) { // We limit ourself to players and pets owned by players. ! P_PLAYER victim = dynamic_cast<P_PLAYER>( ri.GetData() ); ! P_NPC npcVictim = dynamic_cast<P_NPC>( ri.GetData() ); // We don't already attack the target, right? --- 118,127 ---- // If we're not tamed, we attack other players as well. if (!npc->isTamed()) { ! MapCharsIterator ri = MapObjects::instance()->listCharsInCircle( npc->pos(), VISRANGE ); ! for ( P_CHAR pChar = ri.first(); pChar; pChar = ri.next() ) ! { // We limit ourself to players and pets owned by players. ! P_PLAYER victim= dynamic_cast<P_PLAYER>( pChar ); ! P_NPC npcVictim = dynamic_cast<P_NPC>( pChar ); // We don't already attack the target, right? *************** *** 269,273 **** // 1.0 = Full Health, 0.0 = Dead ! float diff = 1.0 - QMAX( 0, ( m_npc->maxHitpoints() - m_npc->hitpoints() ) / ( float ) m_npc->maxHitpoints() ); if ( diff <= m_npc->criticalHealth() / 100.0 ) --- 270,274 ---- // 1.0 = Full Health, 0.0 = Dead ! float diff = 1.0 - wpMax<float>( 0, ( m_npc->maxHitpoints() - m_npc->hitpoints() ) / ( float ) m_npc->maxHitpoints() ); if ( diff <= m_npc->criticalHealth() / 100.0 ) *************** *** 314,318 **** // 1.0 = Full Health, 0.0 = Dead ! float diff = 1.0 - QMAX( 0, ( m_npc->maxHitpoints() - m_npc->hitpoints() ) / ( float ) m_npc->maxHitpoints() ); if ( diff <= m_npc->criticalHealth() / 100.0 ) --- 315,319 ---- // 1.0 = Full Health, 0.0 = Dead ! float diff = 1.0 - wpMax<float>( 0, ( m_npc->maxHitpoints() - m_npc->hitpoints() ) / ( float ) m_npc->maxHitpoints() ); if ( diff <= m_npc->criticalHealth() / 100.0 ) *************** *** 394,398 **** // 1.0 = Full Health, 0.0 = Dead ! float diff = 1.0 - QMAX( 0, ( m_npc->maxHitpoints() - m_npc->hitpoints() ) / ( float ) m_npc->maxHitpoints() ); if ( diff <= m_npc->criticalHealth() / 100.0 ) --- 395,399 ---- // 1.0 = Full Health, 0.0 = Dead ! float diff = 1.0 - wpMax<float>( 0, ( m_npc->maxHitpoints() - m_npc->hitpoints() ) / ( float ) m_npc->maxHitpoints() ); if ( diff <= m_npc->criticalHealth() / 100.0 ) *************** *** 438,442 **** // 1.0 = Full Health, 0.0 = Dead ! float diff = 1.0 - QMAX( 0, ( m_npc->maxHitpoints() - m_npc->hitpoints() ) / ( float ) m_npc->maxHitpoints() ); if ( diff <= m_npc->criticalHealth() / 100.0 ) --- 439,443 ---- // 1.0 = Full Health, 0.0 = Dead ! float diff = 1.0 - wpMax<float>( 0, ( m_npc->maxHitpoints() - m_npc->hitpoints() ) / ( float ) m_npc->maxHitpoints() ); if ( diff <= m_npc->criticalHealth() / 100.0 ) Index: ai_mage.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/ai/ai_mage.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ai_mage.cpp 17 Oct 2004 15:48:56 -0000 1.6 --- ai_mage.cpp 3 Nov 2004 02:09:30 -0000 1.7 *************** *** 4,9 **** #include "../npc.h" #include "../combat.h" ! #include "../serverconfig.h" #include "../walking.h" /* --- 4,10 ---- #include "../npc.h" #include "../combat.h" ! #include "../inlines.h" #include "../walking.h" + #include "../serverconfig.h" /* *************** *** 98,102 **** int spell; cUObject *objTarget; ! Coord_cl posTarget; public: --- 99,103 ---- int spell; cUObject *objTarget; ! Coord posTarget; public: *************** *** 105,109 **** spell = -1; // Current Spell objTarget = 0; ! posTarget = Coord_cl::null; } --- 106,110 ---- spell = -1; // Current Spell objTarget = 0; ! posTarget = Coord::null; } *************** *** 174,181 **** Get the id of a random damage spell */ ! int getRandomHarmfulSpell() { ! static const float mageryPerCircle = (1000.0 / 7.0); ! unsigned char maxCircle = QMIN(8, QMAX(1, (unsigned char)((m_npc->skillValue(MAGERY) + 200) / mageryPerCircle))); ! int selected = RandomNum(1, maxCircle * 2) - 1; // Select a random spell // 5: Magic Arrow --- 175,183 ---- Get the id of a random damage spell */ ! int getRandomHarmfulSpell() ! { ! static const ushort mageryPerCircle = ( 1000 / 7 ); ! int maxCircle = wpMin<int>( 8, wpMax<int>( 1, ( ( m_npc->skillValue( MAGERY ) + 200 ) / mageryPerCircle ) ) ); ! int selected = RandomNum( 1, maxCircle * 2 ) - 1; // Select a random spell // 5: Magic Arrow *************** *** 195,199 **** Chose a random spell */ ! void chooseSpell(int &spell, cUObject *&objTarget, Coord_cl &posTarget, P_CHAR currentVictim) { // If we are not summoned, try healing if (m_npc->hitpoints() < m_npc->maxHitpoints() // Only try to heal if we're not at full health --- 197,201 ---- Chose a random spell */ ! void chooseSpell(int &spell, cUObject *&objTarget, Coord &posTarget, P_CHAR currentVictim) { // If we are not summoned, try healing if (m_npc->hitpoints() < m_npc->maxHitpoints() // Only try to heal if we're not at full health *************** *** 233,237 **** spell = -1; objTarget = 0; ! posTarget = Coord_cl::null; // We dont have a spell ready, are ready to cast. --- 235,239 ---- spell = -1; objTarget = 0; ! posTarget = Coord::null; // We dont have a spell ready, are ready to cast. Index: ai.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/ai/ai.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** ai.h 16 Oct 2004 18:19:41 -0000 1.21 --- ai.h 3 Nov 2004 02:09:30 -0000 1.22 *************** *** 46,50 **** // forward declarations ! class Coord_cl; class AbstractAI; --- 46,50 ---- // forward declarations ! class Coord; class AbstractAI; *************** *** 181,185 **** }; ! typedef SingletonHolder<cAIFactory> AIFactory; class Action_Wander : public AbstractAction --- 181,185 ---- }; ! typedef Singleton<cAIFactory> AIFactory; class Action_Wander : public AbstractAction *************** *** 203,208 **** protected: ! bool moveTo( const Coord_cl& pos, bool run = false ); ! bool movePath( const Coord_cl& pos, bool run = false ); int waitForPathCalculation; }; --- 203,208 ---- protected: ! bool moveTo( const Coord& pos, bool run = false ); ! bool movePath( const Coord& pos, bool run = false ); int waitForPathCalculation; }; Index: ai.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/ai/ai.cpp,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** ai.cpp 26 Oct 2004 18:37:33 -0000 1.41 --- ai.cpp 3 Nov 2004 02:09:30 -0000 1.42 *************** *** 30,35 **** #include "ai.h" #include "../npc.h" - #include "../sectors.h" #include "../player.h" #include "../serverconfig.h" --- 30,35 ---- #include "ai.h" #include "../npc.h" #include "../player.h" + #include "../mapobjects.h" #include "../serverconfig.h" *************** *** 582,586 **** } ! Coord_cl newpos = Movement::instance()->calcCoordFromDir( dir, m_npc->pos() ); // Calculate a new direction. --- 582,586 ---- } ! Coord newpos = Movement::instance()->calcCoordFromDir( dir, m_npc->pos() ); // Calculate a new direction. *************** *** 650,654 **** Q_UINT16 rndy = RandomNum( m_npc->wanderY1(), m_npc->wanderY2() ); ! Q_UINT8 dir = m_npc->pos().direction( Coord_cl( rndx, rndy ) ); Movement::instance()->Walking( m_npc, dir, 0xFF ); break; --- 650,654 ---- Q_UINT16 rndy = RandomNum( m_npc->wanderY1(), m_npc->wanderY2() ); ! Q_UINT8 dir = m_npc->pos().direction( Coord( rndx, rndy ) ); Movement::instance()->Walking( m_npc, dir, 0xFF ); break; *************** *** 656,660 **** case enCircle: { ! Coord_cl pos = m_npc->pos(); pos.x = m_npc->wanderX1(); pos.y = m_npc->wanderY1(); --- 656,660 ---- case enCircle: { ! Coord pos = m_npc->pos(); pos.x = m_npc->wanderX1(); pos.y = m_npc->wanderY1(); *************** *** 711,719 **** } ! bool Action_Wander::moveTo( const Coord_cl& pos, bool run ) { // simply move towards the target Q_UINT8 dir = m_npc->pos().direction( pos ); ! Coord_cl newPos = Movement::instance()->calcCoordFromDir( dir, m_npc->pos() ); if ( !mayWalk( m_npc, newPos ) ) --- 711,719 ---- } ! bool Action_Wander::moveTo( const Coord& pos, bool run ) { // simply move towards the target Q_UINT8 dir = m_npc->pos().direction( pos ); ! Coord newPos = Movement::instance()->calcCoordFromDir( dir, m_npc->pos() ); if ( !mayWalk( m_npc, newPos ) ) *************** *** 759,763 **** } ! bool Action_Wander::movePath( const Coord_cl& pos, bool run ) { if ( waitForPathCalculation <= 0 && !m_npc->hasPath() ) --- 759,763 ---- } ! bool Action_Wander::movePath( const Coord& pos, bool run ) { if ( waitForPathCalculation <= 0 && !m_npc->hasPath() ) *************** *** 787,791 **** { waitForPathCalculation = 0; ! Coord_cl nextmove = m_npc->nextMove(); Q_UINT8 dir = m_npc->pos().direction( nextmove ); --- 787,791 ---- { waitForPathCalculation = 0; ! Coord nextmove = m_npc->nextMove(); Q_UINT8 dir = m_npc->pos().direction( nextmove ); *************** *** 826,831 **** if ( !m_npc->hasPath() ) { ! Coord_cl newPos = m_npc->pos(); ! Coord_cl fleePos = pFleeFrom->pos(); // find a valid spot in a circle of flee_radius fields to move to --- 826,831 ---- if ( !m_npc->hasPath() ) { ! Coord newPos = m_npc->pos(); ! Coord fleePos = pFleeFrom->pos(); // find a valid spot in a circle of flee_radius fields to move to *************** *** 873,877 **** // 1.0 = Full Health, 0.0 = Dead ! float diff = 1.0 - QMAX( 0, ( m_npc->maxHitpoints() - m_npc->hitpoints() ) / ( float ) m_npc->maxHitpoints() ); if ( diff <= m_npc->criticalHealth() / 100.0 ) --- 873,877 ---- // 1.0 = Full Health, 0.0 = Dead ! float diff = 1.0 - wpMax<float>( 0, ( m_npc->maxHitpoints() - m_npc->hitpoints() ) / ( float ) m_npc->maxHitpoints() ); if ( diff <= m_npc->criticalHealth() / 100.0 ) *************** *** 901,905 **** // 1.0 = Full Health, 0.0 = Dead ! float diff = 1.0 - QMAX( 0, ( m_npc->maxHitpoints() - m_npc->hitpoints() ) / ( float ) m_npc->maxHitpoints() ); if ( diff <= m_npc->criticalHealth() / 100.0 ) --- 901,905 ---- // 1.0 = Full Health, 0.0 = Dead ! float diff = 1.0 - wpMax<float>( 0, ( m_npc->maxHitpoints() - m_npc->hitpoints() ) / ( float ) m_npc->maxHitpoints() ); if ( diff <= m_npc->criticalHealth() / 100.0 ) *************** *** 946,950 **** // 1.0 = Full Health, 0.0 = Dead ! float diff = 1.0 - QMAX( 0, ( m_npc->maxHitpoints() - m_npc->hitpoints() ) / ( float ) m_npc->maxHitpoints() ); if ( diff <= m_npc->criticalHealth() / 100.0 ) --- 946,950 ---- // 1.0 = Full Health, 0.0 = Dead ! float diff = 1.0 - wpMax<float>( 0, ( m_npc->maxHitpoints() - m_npc->hitpoints() ) / ( float ) m_npc->maxHitpoints() ); if ( diff <= m_npc->criticalHealth() / 100.0 ) *************** *** 988,992 **** // 1.0 = Full Health, 0.0 = Dead ! float diff = 1.0 - QMAX( 0, ( m_npc->maxHitpoints() - m_npc->hitpoints() ) / ( float ) m_npc->maxHitpoints() ); if ( diff <= m_npc->criticalHealth() / 100.0 ) --- 988,992 ---- // 1.0 = Full Health, 0.0 = Dead ! float diff = 1.0 - wpMax<float>( 0, ( m_npc->maxHitpoints() - m_npc->hitpoints() ) / ( float ) m_npc->maxHitpoints() ); if ( diff <= m_npc->criticalHealth() / 100.0 ) |
From: HellRaider <hel...@us...> - 2004-11-03 02:10:12
|
Update of /cvsroot/wpdev/wolfpack/muls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29663/muls Modified Files: maps.cpp maps.h multiscache.h tilecache.h Log Message: New sectors code and more. A changelog will be sent to the mailing list. Index: maps.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/muls/maps.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** maps.cpp 9 Oct 2004 14:32:22 -0000 1.16 --- maps.cpp 3 Nov 2004 02:09:31 -0000 1.17 *************** *** 28,37 **** #include "maps.h" #include "tilecache.h" - #include "../sectors.h" #include "multiscache.h" ! #include "../defines.h" #include "../items.h" #include "../console.h" ! #include "../log.h" #include "../serverconfig.h" --- 28,37 ---- #include "maps.h" #include "tilecache.h" #include "multiscache.h" ! #include "../log.h" #include "../items.h" #include "../console.h" ! #include "../defines.h" ! #include "../mapobjects.h" #include "../serverconfig.h" *************** *** 382,390 **** \overload Overloaded method, like the above, but takes coordinates and map id out of ! a Coord_cl instance. ! \sa Coord_cl \sa map_st */ ! map_st cMaps::seekMap( const Coord_cl& p ) const { return seekMap( p.map, p.x, p.y ); --- 382,390 ---- \overload Overloaded method, like the above, but takes coordinates and map id out of ! a Coord instance. ! \sa Coord \sa map_st */ ! map_st cMaps::seekMap( const Coord& p ) const { return seekMap( p.map, p.x, p.y ); *************** *** 394,398 **** Returns the elevation (z) of map tile located at \a p. */ ! signed char cMaps::mapElevation( const Coord_cl& p ) const { map_st map = seekMap( p ); --- 394,398 ---- Returns the elevation (z) of map tile located at \a p. */ ! signed char cMaps::mapElevation( const Coord& p ) const { map_st map = seekMap( p ); *************** *** 430,434 **** } ! void cMaps::mapTileSpan(const Coord_cl &pos, unsigned short &id, int &bottom, int &top) const { int topZ, bottomZ, leftZ, rightZ; --- 430,435 ---- } ! void cMaps::mapTileSpan( const Coord &pos, unsigned short &id, int &bottom, int &top ) const ! { int topZ, bottomZ, leftZ, rightZ; *************** *** 448,455 **** // Get the smallest of the z values ! bottom = QMIN( QMIN( QMIN(topZ, leftZ), rightZ), bottomZ); // Get the highest of the z values ! top = QMAX( QMAX( QMAX(topZ, leftZ), rightZ), bottomZ); } --- 449,456 ---- // Get the smallest of the z values ! bottom = wpMin<int>( wpMin<int>( wpMin<int>( topZ, leftZ ), rightZ ), bottomZ ); // Get the highest of the z values ! top = wpMax<int>( wpMax<int>( wpMax<int>( topZ, leftZ ), rightZ ), bottomZ ); } *************** *** 462,466 **** and lowerst values that composes the average */ ! signed char cMaps::mapAverageElevation( const Coord_cl& p, int* top /* = 0 */, int* botton /* = 0 */ ) const { // first thing is to get the map where we are standing --- 463,467 ---- and lowerst values that composes the average */ ! signed char cMaps::mapAverageElevation( const Coord& p, int* top /* = 0 */, int* botton /* = 0 */ ) const { // first thing is to get the map where we are standing *************** *** 471,477 **** { // get three other nearby titles to decide on an average z? ! Q_INT8 map2z = mapElevation( p + Coord_cl( 1, 0, 0 ) ); ! Q_INT8 map3z = mapElevation( p + Coord_cl( 0, 1, 0 ) ); ! Q_INT8 map4z = mapElevation( p + Coord_cl( 1, 1, 0 ) ); Q_INT8 testz = 0; --- 472,478 ---- { // get three other nearby titles to decide on an average z? ! Q_INT8 map2z = mapElevation( p + Coord( 1, 0, 0 ) ); ! Q_INT8 map3z = mapElevation( p + Coord( 0, 1, 0 ) ); ! Q_INT8 map4z = mapElevation( p + Coord( 1, 1, 0 ) ); Q_INT8 testz = 0; *************** *** 526,530 **** // check statics too ! StaticsIterator StaticTiles = staticsIterator( Coord_cl( x, y, z, map ) ); for ( ; !StaticTiles.atEnd(); ++StaticTiles ) { --- 527,531 ---- // check statics too ! StaticsIterator StaticTiles = staticsIterator( Coord( x, y, z, map ) ); for ( ; !StaticTiles.atEnd(); ++StaticTiles ) { *************** *** 553,564 **** } ! signed char cMaps::dynamicElevation( const Coord_cl& pos ) const { ! //int z = ILLEGAL_Z; ! signed char z = ILLEGAL_Z; ! RegionIterator4Items ri( pos ); ! for ( ri.Begin(); !ri.atEnd(); ri++ ) { - P_ITEM mapitem = ri.GetData(); if ( mapitem != NULL ) { --- 554,563 ---- } ! signed char cMaps::dynamicElevation( const Coord& pos ) const { ! SI08 z = ILLEGAL_Z; ! MapItemsIterator ri = MapObjects::instance()->listItemsInCircle( pos, 18 ); ! for ( P_ITEM mapitem = ri.first(); mapitem; mapitem = ri.next() ) { if ( mapitem != NULL ) { *************** *** 587,591 **** } ! signed char cMaps::staticTop( const Coord_cl& pos ) const { signed char top = ILLEGAL_Z; --- 586,590 ---- } ! signed char cMaps::staticTop( const Coord& pos ) const { signed char top = ILLEGAL_Z; *************** *** 605,609 **** // Return new height of player who walked to X/Y but from OLDZ ! signed char cMaps::height( const Coord_cl& pos ) { // let's check in this order.. dynamic, static, then the map --- 604,608 ---- // Return new height of player who walked to X/Y but from OLDZ ! signed char cMaps::height( const Coord& pos ) { // let's check in this order.. dynamic, static, then the map *************** *** 630,634 **** } ! StaticsIterator cMaps::staticsIterator( const Coord_cl& p, bool exact /* = true */ ) const throw( wpException ) { return staticsIterator( p.map, p.x, p.y, exact ); --- 629,633 ---- } ! StaticsIterator cMaps::staticsIterator( const Coord& p, bool exact /* = true */ ) const throw( wpException ) { return staticsIterator( p.map, p.x, p.y, exact ); Index: tilecache.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/muls/tilecache.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tilecache.h 19 Aug 2004 01:22:55 -0000 1.3 --- tilecache.h 3 Nov 2004 02:09:31 -0000 1.4 *************** *** 172,176 **** }; ! typedef SingletonHolder<cTileCache> TileCache; #endif --- 172,176 ---- }; ! typedef Singleton<cTileCache> TileCache; #endif Index: maps.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/muls/maps.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** maps.h 21 Oct 2004 12:11:19 -0000 1.6 --- maps.h 3 Nov 2004 02:09:31 -0000 1.7 *************** *** 40,44 **** // Forward definitions class MapsPrivate; ! class Coord_cl; class wpException; --- 40,44 ---- // Forward definitions class MapsPrivate; ! class Coord; class wpException; *************** *** 122,138 **** unsigned int staticPatches( unsigned int id ); map_st seekMap( uint id, ushort x, ushort y ) const; ! map_st seekMap( const Coord_cl& ) const; bool hasMap( uint id ) const; ! signed char mapElevation( const Coord_cl& p ) const; ! signed char mapAverageElevation( const Coord_cl& p, int* top = 0, int* botton = 0 ) const; ! void mapTileSpan(const Coord_cl &pos, unsigned short &id, int &bottom, int &top) const; ! signed char dynamicElevation( const Coord_cl& pos ) const; ! signed char height( const Coord_cl& pos ); uint mapTileWidth( uint ) const; uint mapTileHeight( uint ) const; ! signed char staticTop( const Coord_cl& pos ) const; bool canFit( int x, int y, int z, uint map ) const; StaticsIterator staticsIterator( uint id, ushort x, ushort y, bool exact = true ) const throw( wpException ); ! StaticsIterator staticsIterator( const Coord_cl&, bool exact = true ) const throw( wpException ); }; --- 122,138 ---- unsigned int staticPatches( unsigned int id ); map_st seekMap( uint id, ushort x, ushort y ) const; ! map_st seekMap( const Coord& ) const; bool hasMap( uint id ) const; ! signed char mapElevation( const Coord& p ) const; ! signed char mapAverageElevation( const Coord& p, int* top = 0, int* botton = 0 ) const; ! void mapTileSpan(const Coord &pos, unsigned short &id, int &bottom, int &top) const; ! signed char dynamicElevation( const Coord& pos ) const; ! signed char height( const Coord& pos ); uint mapTileWidth( uint ) const; uint mapTileHeight( uint ) const; ! signed char staticTop( const Coord& pos ) const; bool canFit( int x, int y, int z, uint map ) const; StaticsIterator staticsIterator( uint id, ushort x, ushort y, bool exact = true ) const throw( wpException ); ! StaticsIterator staticsIterator( const Coord&, bool exact = true ) const throw( wpException ); }; *************** *** 189,193 **** } ! typedef SingletonHolder<cMaps> Maps; #endif // __MAPS_H__ --- 189,193 ---- } ! typedef Singleton<cMaps> Maps; #endif // __MAPS_H__ Index: multiscache.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/muls/multiscache.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** multiscache.h 21 Oct 2004 12:11:19 -0000 1.4 --- multiscache.h 3 Nov 2004 02:09:31 -0000 1.5 *************** *** 101,105 **** }; ! typedef SingletonHolder<cMultiCache> MultiCache; #endif // __MULTISCACHE_H__ --- 101,105 ---- }; ! typedef Singleton<cMultiCache> MultiCache; #endif // __MULTISCACHE_H__ |
From: HellRaider <hel...@us...> - 2004-11-03 02:09:45
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29663/python Modified Files: char.cpp engine.cpp engine.h global.cpp item.cpp pycoord.cpp pyregion.cpp regioniterator.h socket.cpp target.cpp target.h tempeffect.h utilities.h Log Message: New sectors code and more. A changelog will be sent to the mailing list. Index: utilities.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/utilities.h,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** utilities.h 30 Sep 2004 19:58:52 -0000 1.46 --- utilities.h 3 Nov 2004 02:09:33 -0000 1.47 *************** *** 38,42 **** class cItem; class cBaseChar; ! class Coord_cl; class cAccount; class cTerritory; --- 38,42 ---- class cItem; class cBaseChar; ! class Coord; class cAccount; class cTerritory; *************** *** 78,84 **** bool checkWpCoord( PyObject* object ); ! int PyConvertCoord( PyObject* object, Coord_cl* pos ); ! PyObject* PyGetCoordObject( const Coord_cl& coord ); ! Coord_cl getWpCoord( PyObject* object ); bool checkWpItem( PyObject* object ); --- 78,84 ---- bool checkWpCoord( PyObject* object ); ! int PyConvertCoord( PyObject* object, Coord* pos ); ! PyObject* PyGetCoordObject( const Coord& coord ); ! Coord getWpCoord( PyObject* object ); bool checkWpItem( PyObject* object ); Index: regioniterator.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/regioniterator.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** regioniterator.h 7 Sep 2004 03:21:50 -0000 1.15 --- regioniterator.h 3 Nov 2004 02:09:33 -0000 1.16 *************** *** 29,35 **** #define __REGIONITERATOR_H__ - #include "../defines.h" #include "utilities.h" ! #include "../sectors.h" /* --- 29,35 ---- #define __REGIONITERATOR_H__ #include "utilities.h" ! #include "../defines.h" ! #include "../mapobjects.h" /* *************** *** 46,55 **** { PyObject_HEAD; ! cItemSectorIterator* iter; } wpRegionIteratorItems; static void wpItemIteratorDealloc( PyObject* self ) { ! delete ( ( wpRegionIteratorItems * ) self )->iter; PyObject_Del( self ); } --- 46,55 ---- { PyObject_HEAD; ! MapItemsIterator iter; } wpRegionIteratorItems; static void wpItemIteratorDealloc( PyObject* self ) { ! reinterpret_cast<wpRegionIteratorItems *>( self )->iter.~MapItemsIterator(); PyObject_Del( self ); } *************** *** 62,66 **** */ if ( !strcmp( name, "first" ) ) ! return PyGetItemObject( self->iter->first() ); /* \rproperty itemregioniterator.next Accessing this property will advance the iterator to the next item and return it. --- 62,66 ---- */ if ( !strcmp( name, "first" ) ) ! return PyGetItemObject( self->iter.first() ); /* \rproperty itemregioniterator.next Accessing this property will advance the iterator to the next item and return it. *************** *** 68,72 **** */ else if ( !strcmp( name, "next" ) ) ! return PyGetItemObject( self->iter->next() ); Py_RETURN_FALSE; --- 68,72 ---- */ else if ( !strcmp( name, "next" ) ) ! return PyGetItemObject( self->iter.next() ); Py_RETURN_FALSE; *************** *** 75,107 **** static PyTypeObject wpRegionIteratorItemsType = { ! PyObject_HEAD_INIT( NULL ) ! 0, ! "wpItemRegionIterator", ! sizeof( wpRegionIteratorItemsType ), ! 0, ! wpItemIteratorDealloc, ! 0, ! ( getattrfunc ) wpRegionIteratorItems_getAttr, ! 0, ! 0, ! 0, ! 0, ! 0, ! 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, }; static PyObject* PyGetItemRegionIterator( unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2, unsigned char map ) { wpRegionIteratorItems* returnVal = PyObject_New( wpRegionIteratorItems, &wpRegionIteratorItemsType ); ! returnVal->iter = SectorMaps::instance()->findItems( map, x1, y1, x2, y2 ); ! return ( PyObject * ) returnVal; } static PyObject* PyGetItemRegionIterator( unsigned short xBlock, unsigned short yBlock, unsigned char map ) { wpRegionIteratorItems* returnVal = PyObject_New( wpRegionIteratorItems, &wpRegionIteratorItemsType ); ! returnVal->iter = SectorMaps::instance()->findItems( map, xBlock * 8, yBlock * 8 ); ! return ( PyObject * ) returnVal; } --- 75,114 ---- static PyTypeObject wpRegionIteratorItemsType = { ! PyObject_HEAD_INIT( NULL ) ! 0, ! "wpItemRegionIterator", ! sizeof( wpRegionIteratorItemsType ), ! 0, ! wpItemIteratorDealloc, ! 0, ! ( getattrfunc ) wpRegionIteratorItems_getAttr, ! 0, ! 0, ! 0, ! 0, ! 0, ! 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, }; static PyObject* PyGetItemRegionIterator( unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2, unsigned char map ) { + // must manually initialize the iterator's state to zero wpRegionIteratorItems* returnVal = PyObject_New( wpRegionIteratorItems, &wpRegionIteratorItemsType ); ! *reinterpret_cast<void **>( &returnVal->iter ) = NULL; ! returnVal->iter = MapObjects::instance()->listItemsInRect( map, x1, y1, x2, y2 ); ! ! return reinterpret_cast<PyObject *>( returnVal ); } static PyObject* PyGetItemRegionIterator( unsigned short xBlock, unsigned short yBlock, unsigned char map ) { + // must manually initialize the iterator's state to zero wpRegionIteratorItems* returnVal = PyObject_New( wpRegionIteratorItems, &wpRegionIteratorItemsType ); ! *reinterpret_cast<void **>( &returnVal->iter ) = NULL; ! ! returnVal->iter = MapObjects::instance()->listItemsInBlock( map, xBlock * 8, yBlock * 8 ); ! ! return reinterpret_cast<PyObject *>( returnVal ); } *************** *** 122,131 **** { PyObject_HEAD; ! cCharSectorIterator* iter; } wpRegionIteratorChars; static void wpCharIteratorDealloc( PyObject* self ) { ! delete ( ( wpRegionIteratorChars * ) self )->iter; PyObject_Del( self ); } --- 129,138 ---- { PyObject_HEAD; ! MapCharsIterator iter; } wpRegionIteratorChars; static void wpCharIteratorDealloc( PyObject* self ) { ! reinterpret_cast<wpRegionIteratorChars *>( self )->iter.~MapCharsIterator(); PyObject_Del( self ); } *************** *** 138,142 **** */ if ( !strcmp( name, "first" ) ) ! return PyGetCharObject( self->iter->first() ); /* \rproperty charregioniterator.next Accessing this property will advance the iterator to the next character and return it. --- 145,149 ---- */ if ( !strcmp( name, "first" ) ) ! return PyGetCharObject( self->iter.first() ); /* \rproperty charregioniterator.next Accessing this property will advance the iterator to the next character and return it. *************** *** 144,148 **** */ else if ( !strcmp( name, "next" ) ) ! return PyGetCharObject( self->iter->next() ); Py_RETURN_FALSE; --- 151,155 ---- */ else if ( !strcmp( name, "next" ) ) ! return PyGetCharObject( self->iter.next() ); Py_RETURN_FALSE; *************** *** 151,183 **** static PyTypeObject wpRegionIteratorCharsType = { ! PyObject_HEAD_INIT( NULL ) ! 0, ! "wpCharRegionIterator", ! sizeof( wpRegionIteratorCharsType ), ! 0, ! wpCharIteratorDealloc, ! 0, ! ( getattrfunc ) wpRegionIteratorChars_getAttr, ! 0, ! 0, ! 0, ! 0, ! 0, ! 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, }; ! static PyObject* PyGetCharRegionIterator( unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2, unsigned char map, bool includeoffline = false ) { wpRegionIteratorChars* returnVal = PyObject_New( wpRegionIteratorChars, &wpRegionIteratorCharsType ); ! returnVal->iter = SectorMaps::instance()->findChars( map, x1, y1, x2, y2, includeoffline ); ! return ( PyObject * ) returnVal; } ! static PyObject* PyGetCharRegionIterator( unsigned short xBlock, unsigned short yBlock, unsigned char map, bool includeoffline = false ) { wpRegionIteratorChars* returnVal = PyObject_New( wpRegionIteratorChars, &wpRegionIteratorCharsType ); ! returnVal->iter = SectorMaps::instance()->findChars( map, xBlock * 8, yBlock * 8, includeoffline ); ! return ( PyObject * ) returnVal; } --- 158,197 ---- static PyTypeObject wpRegionIteratorCharsType = { ! PyObject_HEAD_INIT( NULL ) ! 0, ! "wpCharRegionIterator", ! sizeof( wpRegionIteratorCharsType ), ! 0, ! wpCharIteratorDealloc, ! 0, ! ( getattrfunc ) wpRegionIteratorChars_getAttr, ! 0, ! 0, ! 0, ! 0, ! 0, ! 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, }; ! static PyObject* PyGetCharRegionIterator( unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2, unsigned char map, bool offline = false ) { + // must manually initialize the iterator's state to zero wpRegionIteratorChars* returnVal = PyObject_New( wpRegionIteratorChars, &wpRegionIteratorCharsType ); ! *reinterpret_cast<void **>( &returnVal->iter ) = NULL; ! returnVal->iter = MapObjects::instance()->listCharsInRect( map, x1, y1, x2, y2, offline ); ! ! return reinterpret_cast<PyObject *>( returnVal ); } ! static PyObject* PyGetCharRegionIterator( unsigned short xBlock, unsigned short yBlock, unsigned char map, bool offline = false ) { + // must manually initialize the iterator's state to zero wpRegionIteratorChars* returnVal = PyObject_New( wpRegionIteratorChars, &wpRegionIteratorCharsType ); ! *reinterpret_cast<void **>( &returnVal->iter ) = NULL; ! ! returnVal->iter = MapObjects::instance()->listCharsInBlock( map, xBlock * 8, yBlock * 8, offline ); ! ! return reinterpret_cast<PyObject *>( returnVal ); } Index: socket.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/socket.cpp,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** socket.cpp 18 Oct 2004 12:09:53 -0000 1.90 --- socket.cpp 3 Nov 2004 02:09:33 -0000 1.91 *************** *** 691,699 **** cVariant value = self->pSock->tags().get( key ); ! if ( value.type() == cVariant::String ) return QString2Python(value.toString()); ! else if ( value.type() == cVariant::Int ) return PyInt_FromLong( value.asInt() ); ! else if ( value.type() == cVariant::Double ) return PyFloat_FromDouble( value.asDouble() ); --- 691,699 ---- cVariant value = self->pSock->tags().get( key ); ! if ( value.type() == cVariant::StringType ) return QString2Python(value.toString()); ! else if ( value.type() == cVariant::IntType ) return PyInt_FromLong( value.asInt() ); ! else if ( value.type() == cVariant::DoubleType ) return PyFloat_FromDouble( value.asDouble() ); Index: pycoord.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/pycoord.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** pycoord.cpp 9 Oct 2004 01:17:50 -0000 1.27 --- pycoord.cpp 3 Nov 2004 02:09:33 -0000 1.28 *************** *** 43,47 **** { PyObject_HEAD; ! Coord_cl coord; } wpCoord; --- 43,47 ---- { PyObject_HEAD; ! Coord coord; } wpCoord; *************** *** 49,53 **** static PyObject* wpCoord_str( wpCoord* object ) { ! const Coord_cl &pos = object->coord; return PyString_FromFormat( "%i,%i,%i,%i", pos.x, pos.y, ( int ) pos.z, pos.map ); } --- 49,53 ---- static PyObject* wpCoord_str( wpCoord* object ) { ! const Coord &pos = object->coord; return PyString_FromFormat( "%i,%i,%i,%i", pos.x, pos.y, ( int ) pos.z, pos.map ); } *************** *** 89,94 **** return -1; ! const Coord_cl &posa = ( ( wpCoord* ) a )->coord; ! const Coord_cl &posb = ( ( wpCoord* ) b )->coord; if ( posa.x != posb.x || posa.y != posb.y || posa.z != posb.z || posa.map != posb.map ) --- 89,94 ---- return -1; ! const Coord &posa = ( ( wpCoord* ) a )->coord; ! const Coord &posb = ( ( wpCoord* ) b )->coord; if ( posa.x != posb.x || posa.y != posb.y || posa.z != posb.z || posa.map != posb.map ) *************** *** 120,124 **** else { ! Coord_cl pos = getWpCoord( PyTuple_GetItem( args, 0 ) ); // Calculate the distance --- 120,124 ---- else { ! Coord pos = getWpCoord( PyTuple_GetItem( args, 0 ) ); // Calculate the distance *************** *** 143,147 **** else { ! Coord_cl pos = getWpCoord( PyTuple_GetItem( args, 0 ) ); // Calculate the distance --- 143,147 ---- else { ! Coord pos = getWpCoord( PyTuple_GetItem( args, 0 ) ); // Calculate the distance *************** *** 172,176 **** static PyObject* wpCoord_lineofsight( wpCoord* self, PyObject* args ) { ! Coord_cl pos; char debug = 0; if ( !PyArg_ParseTuple( args, "O&|b:coord.lineofsight(coord, [debug=0])", &PyConvertCoord, &pos, &debug ) ) --- 172,176 ---- static PyObject* wpCoord_lineofsight( wpCoord* self, PyObject* args ) { ! Coord pos; char debug = 0; if ( !PyArg_ParseTuple( args, "O&|b:coord.lineofsight(coord, [debug=0])", &PyConvertCoord, &pos, &debug ) ) *************** *** 297,301 **** } ! int PyConvertCoord( PyObject* object, Coord_cl* pos ) { if ( object->ob_type != &wpCoordType ) --- 297,301 ---- } ! int PyConvertCoord( PyObject* object, Coord* pos ) { if ( object->ob_type != &wpCoordType ) *************** *** 314,318 **** } ! PyObject* PyGetCoordObject( const Coord_cl& coord ) { wpCoord* cObject = PyObject_New( wpCoord, &wpCoordType ); --- 314,318 ---- } ! PyObject* PyGetCoordObject( const Coord& coord ) { wpCoord* cObject = PyObject_New( wpCoord, &wpCoordType ); *************** *** 321,327 **** } ! Coord_cl getWpCoord( PyObject* object ) { ! Coord_cl coord; if ( object->ob_type == &wpCoordType ) --- 321,327 ---- } ! Coord getWpCoord( PyObject* object ) { ! Coord coord; if ( object->ob_type == &wpCoordType ) Index: tempeffect.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/tempeffect.h,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** tempeffect.h 25 Sep 2004 02:03:22 -0000 1.32 --- tempeffect.h 3 Nov 2004 02:09:33 -0000 1.33 *************** *** 219,223 **** cVariant(pItem).serialize(writer, version); } else if ( checkWpCoord( object ) ) { ! Coord_cl coord = getWpCoord(object); cVariant(coord).serialize(writer, version); } --- 219,223 ---- cVariant(pItem).serialize(writer, version); } else if ( checkWpCoord( object ) ) { ! Coord coord = getWpCoord(object); cVariant(coord).serialize(writer, version); } *************** *** 240,268 **** variant.serialize(reader, version); switch (variant.type()) { ! case cVariant::Long: ! case cVariant::Int: object = PyInt_FromLong(variant.asInt()); break; ! case cVariant::String: object = QString2Python(variant.asString()); break; ! case cVariant::Double: object = PyFloat_FromDouble(variant.asDouble()); break; ! case cVariant::BaseChar: object = PyGetCharObject(variant.toChar()); break; ! case cVariant::Item: object = PyGetItemObject(variant.toItem()); break; ! case cVariant::Coord: object = PyGetCoordObject(variant.toCoord()); break; ! case cVariant::Invalid: break; } --- 240,268 ---- variant.serialize(reader, version); switch (variant.type()) { ! case cVariant::LongType: ! case cVariant::IntType: object = PyInt_FromLong(variant.asInt()); break; ! case cVariant::StringType: object = QString2Python(variant.asString()); break; ! case cVariant::DoubleType: object = PyFloat_FromDouble(variant.asDouble()); break; ! case cVariant::BaseCharType: object = PyGetCharObject(variant.toChar()); break; ! case cVariant::ItemType: object = PyGetItemObject(variant.toItem()); break; ! case cVariant::CoordType: object = PyGetCoordObject(variant.toCoord()); break; ! case cVariant::InvalidType: break; } Index: target.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/target.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** target.cpp 25 Sep 2004 02:03:22 -0000 1.3 --- target.cpp 3 Nov 2004 02:09:33 -0000 1.4 *************** *** 93,97 **** wpTarget* returnVal = PyObject_New( wpTarget, &wpTargetType ); ! Coord_cl pos; pos.x = target->x(); pos.y = target->y(); --- 93,97 ---- wpTarget* returnVal = PyObject_New( wpTarget, &wpTargetType ); ! Coord pos; pos.x = target->x(); pos.y = target->y(); Index: item.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/item.cpp,v retrieving revision 1.141 retrieving revision 1.142 diff -C2 -d -r1.141 -r1.142 *** item.cpp 2 Nov 2004 20:45:46 -0000 1.141 --- item.cpp 3 Nov 2004 02:09:33 -0000 1.142 *************** *** 56,60 **** }; ! typedef SingletonHolder<cItemObjectCache> ItemCache; // Forward Declarations --- 56,60 ---- }; ! typedef Singleton<cItemObjectCache> ItemCache; // Forward Declarations *************** *** 191,195 **** { // Gather parameters ! Coord_cl pos = self->pItem->pos(); uchar noRemove = 0; --- 191,195 ---- { // Gather parameters ! Coord pos = self->pItem->pos(); uchar noRemove = 0; *************** *** 295,299 **** else if ( PyTuple_Size( args ) >= 2 ) // Min 2 { ! Coord_cl pos = self->pItem->pos(); if ( !PyInt_Check( PyTuple_GetItem( args, 0 ) ) || !PyInt_Check( PyTuple_GetItem( args, 1 ) ) ) --- 295,299 ---- else if ( PyTuple_Size( args ) >= 2 ) // Min 2 { ! Coord pos = self->pItem->pos(); if ( !PyInt_Check( PyTuple_GetItem( args, 0 ) ) || !PyInt_Check( PyTuple_GetItem( args, 1 ) ) ) *************** *** 396,404 **** cVariant value = self->pItem->getTag( key ); ! if ( value.type() == cVariant::String ) return QString2Python(value.toString()); ! else if ( value.type() == cVariant::Int ) return PyInt_FromLong( value.asInt() ); ! else if ( value.type() == cVariant::Double ) return PyFloat_FromDouble( value.asDouble() ); --- 396,404 ---- cVariant value = self->pItem->getTag( key ); ! if ( value.type() == cVariant::StringType ) return QString2Python(value.toString()); ! else if ( value.type() == cVariant::IntType ) return PyInt_FromLong( value.asInt() ); ! else if ( value.type() == cVariant::DoubleType ) return PyFloat_FromDouble( value.asDouble() ); *************** *** 552,556 **** object = getArgItem( 1 ); ! Coord_cl pos; if ( checkArgCoord( 1 ) ) --- 552,556 ---- object = getArgItem( 1 ); ! Coord pos; if ( checkArgCoord( 1 ) ) Index: global.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/global.cpp,v retrieving revision 1.168 retrieving revision 1.169 diff -C2 -d -r1.168 -r1.169 *** global.cpp 21 Oct 2004 21:58:05 -0000 1.168 --- global.cpp 3 Nov 2004 02:09:32 -0000 1.169 *************** *** 36,40 **** #include "../uotime.h" #include "../timers.h" ! #include "../sectors.h" #include "../territories.h" #include "../muls/maps.h" --- 36,40 ---- #include "../uotime.h" #include "../timers.h" ! #include "../mapobjects.h" #include "../territories.h" #include "../muls/maps.h" *************** *** 378,382 **** { char* definition; ! Coord_cl pos; if ( !PyArg_ParseTuple( args, "sO&:wolfpack.addnpc(def, pos)", &definition, &PyConvertCoord, &pos ) ) --- 378,382 ---- { char* definition; ! Coord pos; if ( !PyArg_ParseTuple( args, "sO&:wolfpack.addnpc(def, pos)", &definition, &PyConvertCoord, &pos ) ) *************** *** 476,480 **** static PyObject* wpFindmulti( PyObject* /*self*/, PyObject* args ) { ! Coord_cl coord; if ( !PyArg_ParseTuple( args, "O&:wolfpack.findmulti(pos)", &PyConvertCoord, &coord ) ) --- 476,480 ---- static PyObject* wpFindmulti( PyObject* /*self*/, PyObject* args ) { ! Coord coord; if ( !PyArg_ParseTuple( args, "O&:wolfpack.findmulti(pos)", &PyConvertCoord, &coord ) ) *************** *** 647,651 **** y = maxY - 1; ! StaticsIterator iter = Maps::instance()->staticsIterator( Coord_cl( x, y, 0, map ), exact ); PyObject* list = PyList_New( 0 ); --- 647,651 ---- y = maxY - 1; ! StaticsIterator iter = Maps::instance()->staticsIterator( Coord( x, y, 0, map ), exact ); PyObject* list = PyList_New( 0 ); *************** *** 719,732 **** return 0; ! Coord_cl pos( x, y, 0, map ); ! RegionIterator4Items iter( pos, range ); PyObject* list = PyList_New( 0 ); ! for ( iter.Begin(); !iter.atEnd(); iter++ ) { ! P_ITEM pItem = iter.GetData(); ! ! if ( pItem ) ! PyList_Append( list, PyGetItemObject( pItem ) ); } --- 719,729 ---- return 0; ! Coord pos( x, y, 0, map ); ! MapItemsIterator iter = MapObjects::instance()->listItemsInCircle( pos, range ); PyObject* list = PyList_New( 0 ); ! for ( P_ITEM pItem = iter.first(); pItem; pItem = iter.next() ) { ! PyList_Append( list, PyGetItemObject( pItem ) ); } *************** *** 759,772 **** return 0; ! Coord_cl pos( x, y, 0, map ); ! cCharSectorIterator *iter = SectorMaps::instance()->findChars(pos, range, PyObject_IsTrue(offline) != 0); ! PyObject* list = PyList_New( 0 ); ! for ( P_CHAR pChar = iter->first(); pChar; pChar = iter->next() ) { PyList_Append( list, pChar->getPyObject() ); } - delete iter; - return list; } --- 756,767 ---- return 0; ! MapCharsIterator iter = MapObjects::instance()->listCharsInCircle( map, x, y, range, PyObject_IsTrue(offline) != 0 ); ! PyObject* list = PyList_New( 0 ); ! for ( P_CHAR pChar = iter.first(); pChar; pChar = iter.next() ) ! { PyList_Append( list, pChar->getPyObject() ); } return list; } *************** *** 781,785 **** */ static PyObject *wpCanPlace( PyObject* self, PyObject *args ) { ! Coord_cl pos; unsigned short multiid; unsigned short yard; --- 776,780 ---- */ static PyObject *wpCanPlace( PyObject* self, PyObject *args ) { ! Coord pos; unsigned short multiid; unsigned short yard; *************** *** 839,843 **** effect.setSpeed( getArgInt( 2 ) ); ! Coord_cl displaypos = getArgCoord( 1 ); cUOSocket* mSock; --- 834,838 ---- effect.setSpeed( getArgInt( 2 ) ); ! Coord displaypos = getArgCoord( 1 ); cUOSocket* mSock; *************** *** 874,878 **** return 0; ! map_st mTile = Maps::instance()->seekMap( Coord_cl( x, y, 0, map ) ); PyObject* dict = PyDict_New(); --- 869,873 ---- return 0; ! map_st mTile = Maps::instance()->seekMap( Coord( x, y, 0, map ) ); PyObject* dict = PyDict_New(); *************** *** 1183,1187 **** return 0; ! Coord_cl pos( x, y, z, map ); return PyGetCoordObject( pos ); --- 1178,1182 ---- return 0; ! Coord pos( x, y, z, map ); return PyGetCoordObject( pos ); Index: engine.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/engine.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** engine.h 10 Aug 2004 03:27:52 -0000 1.20 --- engine.h 3 Nov 2004 02:09:32 -0000 1.21 *************** *** 96,100 **** }; ! typedef SingletonHolder<cPythonEngine> PythonEngine; void registerCleanupHandler( fnCleanupHandler ); --- 96,100 ---- }; ! typedef Singleton<cPythonEngine> PythonEngine; void registerCleanupHandler( fnCleanupHandler ); Index: target.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/target.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** target.h 25 Sep 2004 02:03:22 -0000 1.25 --- target.h 3 Nov 2004 02:09:33 -0000 1.26 *************** *** 40,44 **** { PyObject_HEAD; ! Coord_cl pos; Q_UINT16 model; SERIAL object; --- 40,44 ---- { PyObject_HEAD; ! Coord pos; Q_UINT16 model; SERIAL object; Index: char.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/char.cpp,v retrieving revision 1.204 retrieving revision 1.205 diff -C2 -d -r1.204 -r1.205 *** char.cpp 12 Oct 2004 23:59:28 -0000 1.204 --- char.cpp 3 Nov 2004 02:09:32 -0000 1.205 *************** *** 44,48 **** #include "utilities.h" ! #include "content.h" #include "tempeffect.h" #include "objectcache.h" --- 44,48 ---- #include "utilities.h" ! #include "pycontent.h" #include "tempeffect.h" #include "objectcache.h" *************** *** 304,308 **** // Gather parameters ! Coord_cl pos = self->pChar->pos(); if ( PyTuple_Size( args ) <= 1 ) --- 304,308 ---- // Gather parameters ! Coord pos = self->pChar->pos(); if ( PyTuple_Size( args ) <= 1 ) *************** *** 441,445 **** else if ( PyTuple_Size( args ) >= 2 ) // Min 2 { ! Coord_cl pos = self->pChar->pos(); if ( !PyInt_Check( PyTuple_GetItem( args, 0 ) ) || !PyInt_Check( PyTuple_GetItem( args, 1 ) ) ) --- 441,445 ---- else if ( PyTuple_Size( args ) >= 2 ) // Min 2 { ! Coord pos = self->pChar->pos(); if ( !PyInt_Check( PyTuple_GetItem( args, 0 ) ) || !PyInt_Check( PyTuple_GetItem( args, 1 ) ) ) *************** *** 502,507 **** if ( checkWpCoord( pObj ) ) { ! Coord_cl pos = getWpCoord( pObj ); ! return PyInt_FromLong( self->pChar->pos().direction( Coord_cl( pos.x, pos.y ) ) ); } --- 502,507 ---- if ( checkWpCoord( pObj ) ) { ! Coord pos = getWpCoord( pObj ); ! return PyInt_FromLong( self->pChar->pos().direction( Coord( pos.x, pos.y ) ) ); } *************** *** 517,521 **** else if ( PyTuple_Size( args ) >= 2 ) // Min 2 { ! Coord_cl pos = self->pChar->pos(); if ( !PyInt_Check( PyTuple_GetItem( args, 0 ) ) || !PyInt_Check( PyTuple_GetItem( args, 1 ) ) ) --- 517,521 ---- else if ( PyTuple_Size( args ) >= 2 ) // Min 2 { ! Coord pos = self->pChar->pos(); if ( !PyInt_Check( PyTuple_GetItem( args, 0 ) ) || !PyInt_Check( PyTuple_GetItem( args, 1 ) ) ) *************** *** 968,976 **** cVariant value = self->pChar->getTag( key ); ! if ( value.type() == cVariant::String ) return QString2Python(value.toString()); ! else if ( value.type() == cVariant::Int ) return PyInt_FromLong( value.asInt() ); ! else if ( value.type() == cVariant::Double ) return PyFloat_FromDouble( value.asDouble() ); --- 968,976 ---- cVariant value = self->pChar->getTag( key ); ! if ( value.type() == cVariant::StringType ) return QString2Python(value.toString()); ! else if ( value.type() == cVariant::IntType ) return PyInt_FromLong( value.asInt() ); ! else if ( value.type() == cVariant::DoubleType ) return PyFloat_FromDouble( value.asDouble() ); *************** *** 1275,1279 **** if ( checkArgCoord( 0 ) ) { ! Coord_cl pos = getArgCoord( 0 ); self->pChar->turnTo( pos ); Py_RETURN_NONE; --- 1275,1279 ---- if ( checkArgCoord( 0 ) ) { ! Coord pos = getArgCoord( 0 ); self->pChar->turnTo( pos ); Py_RETURN_NONE; *************** *** 1459,1463 **** if ( checkWpCoord( target ) ) { ! Coord_cl coord = getWpCoord( target ); self->pChar->effect( id, coord, fixedDirection, explodes, speed, hue, renderMode ); } --- 1459,1463 ---- if ( checkWpCoord( target ) ) { ! Coord coord = getWpCoord( target ); self->pChar->effect( id, coord, fixedDirection, explodes, speed, hue, renderMode ); } *************** *** 1735,1744 **** } ! //if( !mayWalk( self->pChar, Coord_cl( getArgInt( 0 ), getArgInt( 1 ), getArgInt( 2 ), getArgInt( 3 ) ) ) ) int argx = getArgInt( 0 ); int argy = getArgInt( 1 ); int argz = getArgInt( 2 ); int argmap = getArgInt( 3 ); ! Coord_cl argcoord( argx, argy, argz, argmap ); if ( !mayWalk( self->pChar, argcoord ) ) Py_RETURN_FALSE; --- 1735,1744 ---- } ! //if( !mayWalk( self->pChar, Coord( getArgInt( 0 ), getArgInt( 1 ), getArgInt( 2 ), getArgInt( 3 ) ) ) ) int argx = getArgInt( 0 ); int argy = getArgInt( 1 ); int argz = getArgInt( 2 ); int argmap = getArgInt( 3 ); ! Coord argcoord( argx, argy, argz, argmap ); if ( !mayWalk( self->pChar, argcoord ) ) Py_RETURN_FALSE; *************** *** 1918,1922 **** } ! Coord_cl pos = getArgCoord( 0 ); if ( pos.map != self->pChar->pos().map ) --- 1918,1922 ---- } ! Coord pos = getArgCoord( 0 ); if ( pos.map != self->pChar->pos().map ) *************** *** 2013,2017 **** } ! Coord_cl targetPos; if (checkWpCoord(target)) { --- 2013,2017 ---- } ! Coord targetPos; if (checkWpCoord(target)) { *************** *** 2049,2053 **** } else if (target->ob_type == &wpTargetType) { SERIAL object = ((wpTarget*)target)->object; ! Coord_cl pos = ((wpTarget*)target)->pos; unsigned short model = ((wpTarget*)target)->model; --- 2049,2053 ---- } else if (target->ob_type == &wpTargetType) { SERIAL object = ((wpTarget*)target)->object; ! Coord pos = ((wpTarget*)target)->pos; unsigned short model = ((wpTarget*)target)->model; *************** *** 2092,2096 **** // Now that we have the target position, measure the distance. ! Coord_cl pos = self->pChar->pos().losCharPoint(true); if (pos.map != targetPos.map) { --- 2092,2096 ---- // Now that we have the target position, measure the distance. ! Coord pos = self->pChar->pos().losCharPoint(true); if (pos.map != targetPos.map) { Index: pyregion.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/pyregion.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** pyregion.cpp 22 Aug 2004 02:29:52 -0000 1.22 --- pyregion.cpp 3 Nov 2004 02:09:33 -0000 1.23 *************** *** 41,45 **** cTerritory* pRegion; bool frozen; // unused yet ! Coord_cl pos; // unused yet } wpRegion; --- 41,45 ---- cTerritory* pRegion; bool frozen; // unused yet ! Coord pos; // unused yet } wpRegion; Index: engine.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/engine.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** engine.cpp 9 Oct 2004 14:32:22 -0000 1.36 --- engine.cpp 3 Nov 2004 02:09:32 -0000 1.37 *************** *** 57,61 **** }; ! typedef SingletonHolder<cCleanupHandlers> CleanupHandlers; void registerCleanupHandler( fnCleanupHandler handler ) --- 57,61 ---- }; ! typedef Singleton<cCleanupHandlers> CleanupHandlers; void registerCleanupHandler( fnCleanupHandler handler ) |
From: HellRaider <hel...@us...> - 2004-11-03 02:09:43
|
Update of /cvsroot/wpdev/wolfpack/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29663/network Modified Files: encryption.h network.h uosocket.cpp uotxpackets.cpp uotxpackets.h Log Message: New sectors code and more. A changelog will be sent to the mailing list. Index: network.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/network/network.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** network.h 25 Sep 2004 22:57:09 -0000 1.5 --- network.h 3 Nov 2004 02:09:31 -0000 1.6 *************** *** 75,79 **** }; ! typedef SingletonHolder<cNetwork> Network; #endif --- 75,79 ---- }; ! typedef Singleton<cNetwork> Network; #endif Index: uosocket.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/network/uosocket.cpp,v retrieving revision 1.437 retrieving revision 1.438 diff -C2 -d -r1.437 -r1.438 *** uosocket.cpp 2 Nov 2004 20:45:46 -0000 1.437 --- uosocket.cpp 3 Nov 2004 02:09:31 -0000 1.438 *************** *** 41,45 **** #include "../territories.h" #include "../inlines.h" ! #include "../sectors.h" #include "../multi.h" #include "../muls/maps.h" --- 41,45 ---- #include "../territories.h" #include "../inlines.h" ! #include "../mapobjects.h" #include "../multi.h" #include "../muls/maps.h" *************** *** 479,483 **** if ( _player ) { ! _player->onLogout(); _player->setSocket( NULL ); --- 479,483 ---- if ( _player ) { ! _player->onDisconnect(); _player->setSocket( NULL ); *************** *** 499,510 **** { _player->removeFromView( true ); ! if ( !_player->isGMorCounselor() && ( !_player->region() || !_player->region()->isGuarded() ) ) { ! _player->setLogoutTime( Server::instance()->time() + Config::instance()->quittime() * 1000 ); } else { ! //SectorMaps::instance()->remove( _player ); } _player->resend( false ); } --- 499,514 ---- { _player->removeFromView( true ); ! ! // is the player allowed to logout instantly? ! if( _player->isGMorCounselor() || ( _player->region() && _player->region()->isGuarded() ) ) { ! _player->onLogout(); } else { ! // let the player linger... ! _player->setLogoutTime( Server::instance()->time() + Config::instance()->quittime() * 1000 ); } + _player->resend( false ); } *************** *** 561,565 **** // Send the server/account features here as well // AoS needs it most likely for account creation ! const uint maxChars = QMIN( 6, Config::instance()->maxCharsPerAccount() ); cUOTxClientFeatures clientFeatures; clientFeatures.setLbr( true ); --- 565,569 ---- // Send the server/account features here as well // AoS needs it most likely for account creation ! const uint maxChars = wpMin<uint>( 6, Config::instance()->maxCharsPerAccount() ); cUOTxClientFeatures clientFeatures; clientFeatures.setLbr( true ); *************** *** 675,679 **** if (!Maps::instance()->hasMap(pChar->pos().map)) { ! Coord_cl pos; pos.x = 0; pos.y = 0; --- 679,683 ---- if (!Maps::instance()->hasMap(pChar->pos().map)) { ! Coord pos; pos.x = 0; pos.y = 0; *************** *** 881,885 **** // If we have more than 6 characters ! const uint maxChars = QMIN( 6, Config::instance()->maxCharsPerAccount() ); if ( characters.size() >= maxChars ) { --- 885,889 ---- // If we have more than 6 characters ! const uint maxChars = wpMin<uint>( 6, Config::instance()->maxCharsPerAccount() ); if ( characters.size() >= maxChars ) { *************** *** 1640,1644 **** void cUOSocket::sendChar( P_CHAR pChar ) { ! if ( pChar == _player ) { updatePlayer(); --- 1644,1648 ---- void cUOSocket::sendChar( P_CHAR pChar ) { ! if( pChar == _player ) { updatePlayer(); *************** *** 1646,1650 **** } ! if ( canSee( pChar ) ) { // Then completely resend it --- 1650,1654 ---- } ! if( canSee( pChar ) ) { // Then completely resend it *************** *** 1657,1663 **** // Send item tooltips cBaseChar::ItemContainer content = pChar->content(); ! for ( cBaseChar::ItemContainer::const_iterator it = content.begin(); it != content.end(); ++it ) { ! it.data()->sendTooltip( this ); } } --- 1661,1671 ---- // Send item tooltips cBaseChar::ItemContainer content = pChar->content(); ! for( cBaseChar::ItemContainer::const_iterator it = content.begin(); it != content.end(); ++it ) { ! P_ITEM item = it.data(); ! if( item->layer() <= 0x19 ) ! { ! item->sendTooltip( this ); ! } } } *************** *** 1689,1693 **** _player->setLogoutTime( 0 ); _player->resend( false ); ! //SectorMaps::instance()->remove( _player ); } --- 1697,1701 ---- _player->setLogoutTime( 0 ); _player->resend( false ); ! //MapObjects::instance()->remove( _player ); } *************** *** 1695,1699 **** _player->setSocket( this ); _player->resend( false ); ! SectorMaps::instance()->add( _player ); } --- 1703,1707 ---- _player->setSocket( this ); _player->resend( false ); ! MapObjects::instance()->add( _player ); } *************** *** 2240,2287 **** return; ! cItemSectorIterator* itemIter = SectorMaps::instance()->findItems( _player->pos(), BUILDRANGE ); ! for ( cItem*item = itemIter->first(); item; item = itemIter->next() ) { if ( clean ) - { removeObject( item ); ! } item->update( this ); } ! RegionIterator4Chars chIterator( _player->pos(), _player->visualRange(), true ); ! for ( chIterator.Begin(); !chIterator.atEnd(); chIterator++ ) { ! P_CHAR pChar = chIterator.GetData(); ! if ( pChar == _player ) ! continue; ! if ( clean ) ! { ! removeObject( pChar ); ! } ! // Hidden ! if ( _player->canSee( pChar ) ) ! { ! cUOTxDrawChar drawChar; ! drawChar.fromChar( pChar ); ! drawChar.setHighlight( pChar->notoriety( _player ) ); ! send( &drawChar ); ! pChar->sendTooltip( this ); ! // Send the equipment Tooltips ! cBaseChar::ItemContainer content = pChar->content(); ! cBaseChar::ItemContainer::const_iterator it; ! for ( it = content.begin(); it != content.end(); it++ ) ! { ! P_ITEM pItem = it.data(); ! if ( pItem->layer() <= 0x19 ) ! { ! pItem->sendTooltip( this ); ! } ! } ! } } } --- 2248,2282 ---- return; ! // resend items ! MapItemsIterator itemIt = MapObjects::instance()->listItemsInCircle( _player->pos(), _player->visualRange() ); ! for( P_ITEM item = itemIt.first(); item; item = itemIt.next() ) { if ( clean ) removeObject( item ); ! item->update( this ); } ! // resend multis ! MapMultisIterator multiIt = MapObjects::instance()->listMultisInCircle( _player->pos(), BUILDRANGE ); ! for( P_MULTI multi = multiIt.first(); multi; multi = multiIt.next() ) { ! if( clean ) ! removeObject( multi ); ! multi->update( this ); ! } ! // send online characters ! MapCharsIterator charIt = MapObjects::instance()->listCharsInCircle( _player->pos(), _player->visualRange() ); ! for( P_CHAR character = charIt.first(); character; character = charIt.next() ) ! { ! if( character == _player ) ! continue; ! if( clean ) ! removeObject( character ); ! sendChar( character ); } } *************** *** 3010,3023 **** if ( _player ) { cUOTxLightLevel pLight; - unsigned char level; cTerritory* region = Territories::instance()->region( _player->pos() ); if ( region && region->isCave() ) { ! level = QMAX( 0, ( int ) Config::instance()->dungeonLightLevel() - _player->fixedLightLevel() ); } else { ! level = QMAX( 0, ( int ) Config::instance()->worldCurrentLevel() - _player->fixedLightLevel() ); } pLight.setLevel( level ); --- 3005,3018 ---- if ( _player ) { + UI08 level; cUOTxLightLevel pLight; cTerritory* region = Territories::instance()->region( _player->pos() ); if ( region && region->isCave() ) { ! level = wpMax<UI08>( 0, Config::instance()->dungeonLightLevel() - static_cast<int>( _player->fixedLightLevel() ) ); } else { ! level = wpMax<UI08>( 0, Config::instance()->worldCurrentLevel() - static_cast<int>( _player->fixedLightLevel() ) ); } pLight.setLevel( level ); *************** *** 3088,3092 **** cUOTxQuestArrow qArrow; qArrow.setActive( show ? 1 : 0 ); ! qArrow.setPos( Coord_cl( x, y, 0, 0 ) ); send( &qArrow ); } --- 3083,3087 ---- cUOTxQuestArrow qArrow; qArrow.setActive( show ? 1 : 0 ); ! qArrow.setPos( Coord( x, y, 0, 0 ) ); send( &qArrow ); } Index: uotxpackets.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/network/uotxpackets.h,v retrieving revision 1.116 retrieving revision 1.117 diff -C2 -d -r1.116 -r1.117 *** uotxpackets.h 18 Oct 2004 12:09:53 -0000 1.116 --- uotxpackets.h 3 Nov 2004 02:09:31 -0000 1.117 *************** *** 33,38 **** #include "qstring.h" #include "qstringlist.h" - #include "../typedefs.h" #include "../coord.h" #include "../objectdef.h" --- 33,39 ---- #include "qstring.h" #include "qstringlist.h" #include "../coord.h" + #include "../inlines.h" + #include "../typedefs.h" #include "../objectdef.h" *************** *** 40,44 **** #include "uopacket.h" ! class Coord_cl; // 0x82: DenyLogin --- 41,45 ---- #include "uopacket.h" ! class Coord; // 0x82: DenyLogin *************** *** 977,985 **** void setLanguage( const QString& data ) { ! this->setAsciiString( 14, data.left( 3 ).latin1(), QMIN( data.length() + 1, 4 ) ); } void setName( const QString& data ) { ! this->setAsciiString( 18, data.left( 29 ).latin1(), QMIN( data.length() + 1, 30 ) ); } void setText( const QString& data ); --- 978,986 ---- void setLanguage( const QString& data ) { ! this->setAsciiString( 14, data.left( 3 ).latin1(), wpMin<uint>( data.length() + 1, 4 ) ); } void setName( const QString& data ) { ! this->setAsciiString( 18, data.left( 29 ).latin1(), wpMin<uint>( data.length() + 1, 30 ) ); } void setText( const QString& data ); *************** *** 1025,1029 **** void setName( const QString& name ) { ! setAsciiString( 7, name.left( 29 ).latin1(), QMIN( name.length() + 1, 30 ) ); } void setHp( unsigned short data ) --- 1026,1030 ---- void setName( const QString& name ) { ! setAsciiString( 7, name.left( 29 ).latin1(), wpMin<uint>( name.length() + 1, 30 ) ); } void setHp( unsigned short data ) *************** *** 1176,1180 **** ( *this )[1] = data; } ! void setCoord( const Coord_cl& coord ); void setDirection( unsigned char data ) { --- 1177,1181 ---- ( *this )[1] = data; } ! void setCoord( const Coord& coord ); void setDirection( unsigned char data ) { *************** *** 1251,1255 **** void setName( const QString& name ) { ! this->setAsciiString( 5, name.left( 59 ).latin1(), QMIN( strlen( name.left( 59 ).latin1() ) + 1, 60 ) ); } void setFlag( unsigned char flag ) --- 1252,1256 ---- void setName( const QString& name ) { ! this->setAsciiString( 5, name.left( 59 ).latin1(), wpMin<uint>( name.length() + 1, 60 ) ); } void setFlag( unsigned char flag ) *************** *** 1310,1314 **** setShort( 9, data ); } ! void setCoord( const Coord_cl& coord ); void setDirection( unsigned char data ) { --- 1311,1315 ---- setShort( 9, data ); } ! void setCoord( const Coord& coord ); void setDirection( unsigned char data ) { *************** *** 1389,1393 **** setShort( 4, data ); } ! void setCoord( const Coord_cl& coord ); }; --- 1390,1394 ---- setShort( 4, data ); } ! void setCoord( const Coord& coord ); }; *************** *** 1604,1608 **** ( *this )[1] = status; } ! void setPos( const Coord_cl& pos ) { setShort( 2, pos.x ); --- 1605,1609 ---- ( *this )[1] = status; } ! void setPos( const Coord& pos ) { setShort( 2, pos.x ); *************** *** 1732,1736 **** setShort( 10, data ); } ! void setSource( const Coord_cl& pos ) { setShort( 12, pos.x ); --- 1733,1737 ---- setShort( 10, data ); } ! void setSource( const Coord& pos ) { setShort( 12, pos.x ); *************** *** 1738,1742 **** ( *this )[16] = pos.z; } ! void setTarget( const Coord_cl& pos ) { setShort( 17, pos.x ); --- 1739,1743 ---- ( *this )[16] = pos.z; } ! void setTarget( const Coord& pos ) { setShort( 17, pos.x ); *************** *** 1986,1990 **** void setName( const QString& data ) { ! this->setAsciiString( 19, data.left( 29 ).latin1(), QMIN( data.length() + 1, 30 ) ); } void setParams( const QString& affix, const QString& params ) --- 1987,1991 ---- void setName( const QString& data ) { ! this->setAsciiString( 19, data.left( 29 ).latin1(), wpMin<uint>( data.length() + 1, 30 ) ); } void setParams( const QString& affix, const QString& params ) *************** *** 2030,2034 **** setShort( 10, data ); } ! void setSourcePos( const Coord_cl& pos ) { setShort( 12, pos.x ); --- 2031,2035 ---- setShort( 10, data ); } ! void setSourcePos( const Coord& pos ) { setShort( 12, pos.x ); *************** *** 2037,2041 **** } ! void setTargetPos( const Coord_cl& pos ) { setShort( 17, pos.x ); --- 2038,2042 ---- } ! void setTargetPos( const Coord& pos ) { setShort( 17, pos.x ); *************** *** 2098,2102 **** setShort( 10, data ); } ! void setSourcePos( const Coord_cl& pos ) { setShort( 12, pos.x ); --- 2099,2103 ---- setShort( 10, data ); } ! void setSourcePos( const Coord& pos ) { setShort( 12, pos.x ); *************** *** 2105,2109 **** } ! void setTargetPos( const Coord_cl& pos ) { setShort( 17, pos.x ); --- 2106,2110 ---- } ! void setTargetPos( const Coord& pos ) { setShort( 17, pos.x ); *************** *** 2391,2395 **** } void addTile( unsigned short id, short x, short y, short z ); ! void addTile( unsigned short id, const Coord_cl& coords ) { addTile( id, coords.x, coords.y, coords.z ); --- 2392,2396 ---- } void addTile( unsigned short id, short x, short y, short z ); ! void addTile( unsigned short id, const Coord& coords ) { addTile( id, coords.x, coords.y, coords.z ); Index: uotxpackets.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/network/uotxpackets.cpp,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** uotxpackets.cpp 26 Oct 2004 18:37:36 -0000 1.104 --- uotxpackets.cpp 3 Nov 2004 02:09:31 -0000 1.105 *************** *** 237,241 **** } ! void cUOTxDenyMove::setCoord( const Coord_cl& coord ) { setShort( 2, coord.x ); --- 237,241 ---- } ! void cUOTxDenyMove::setCoord( const Coord& coord ) { setShort( 2, coord.x ); *************** *** 550,554 **** } ! position = ( position * 5 ) + QMIN( 4, pChar->fame() / 2500 ); if ( pChar->objectType() != enNPC && position < titles.size() ) --- 550,554 ---- } ! position = ( position * 5 ) + wpMin<unsigned int>( 4, pChar->fame() / 2500 ); if ( pChar->objectType() != enNPC && position < titles.size() ) *************** *** 702,706 **** } ! void cUOTxSendItem::setCoord( const Coord_cl& coord ) { setShort( 11, coord.x | 0x8000 ); --- 702,706 ---- } ! void cUOTxSendItem::setCoord( const Coord& coord ) { setShort( 11, coord.x | 0x8000 ); *************** *** 709,713 **** } ! void cUOTxSoundEffect::setCoord( const Coord_cl& coord ) { setShort( 6, coord.x ); --- 709,713 ---- } ! void cUOTxSoundEffect::setCoord( const Coord& coord ) { setShort( 6, coord.x ); Index: encryption.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/network/encryption.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** encryption.h 24 Aug 2004 00:23:22 -0000 1.5 --- encryption.h 3 Nov 2004 02:09:31 -0000 1.6 *************** *** 62,66 **** }; ! typedef SingletonHolder<cKeyManager> KeyManager; // General Client Encryption Class --- 62,66 ---- }; ! typedef Singleton<cKeyManager> KeyManager; // General Client Encryption Class |
From: Richard M. <dr...@us...> - 2004-11-03 01:55:52
|
Update of /cvsroot/wpdev/wolfpack/sqlite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27316/sqlite Modified Files: sqlite.pri Log Message: Cleanups, trying to fix an odd display bug... Index: sqlite.pri =================================================================== RCS file: /cvsroot/wpdev/wolfpack/sqlite/sqlite.pri,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sqlite.pri 23 Aug 2004 19:35:48 -0000 1.1 --- sqlite.pri 3 Nov 2004 01:55:41 -0000 1.2 *************** *** 3,44 **** HEADERS += $$SQLITE_H/btree.h \ ! $$SQLITE_H/config.h \ ! $$SQLITE_H/hash.h \ ! $$SQLITE_H/opcodes.h \ ! $$SQLITE_H/os.h \ ! $$SQLITE_H/pager.h \ ! $$SQLITE_H/parse.h \ ! $$SQLITE_H/sqlite.h \ ! $$SQLITE_H/sqliteInt.h \ ! $$SQLITE_H/vdbe.h \ ! $$SQLITE_H/vdbeInt.h SOURCES += $$SQLITE_CPP/attach.c \ ! $$SQLITE_CPP/auth.c \ ! $$SQLITE_CPP/btree.c \ ! $$SQLITE_CPP/btree_rb.c \ ! $$SQLITE_CPP/build.c \ ! $$SQLITE_CPP/copy.c \ ! $$SQLITE_CPP/date.c \ ! $$SQLITE_CPP/delete.c \ ! $$SQLITE_CPP/expr.c \ ! $$SQLITE_CPP/func.c \ ! $$SQLITE_CPP/hash.c \ ! $$SQLITE_CPP/insert.c \ ! $$SQLITE_CPP/main.c \ ! $$SQLITE_CPP/opcodes.c \ ! $$SQLITE_CPP/os.c \ ! $$SQLITE_CPP/pager.c \ ! $$SQLITE_CPP/parse.c \ ! $$SQLITE_CPP/pragma.c \ ! $$SQLITE_CPP/printf.c \ ! $$SQLITE_CPP/random.c \ ! $$SQLITE_CPP/select.c \ ! $$SQLITE_CPP/table.c \ ! $$SQLITE_CPP/tokenize.c \ ! $$SQLITE_CPP/trigger.c \ ! $$SQLITE_CPP/update.c \ ! $$SQLITE_CPP/util.c \ ! $$SQLITE_CPP/vacuum.c \ ! $$SQLITE_CPP/vdbe.c \ ! $$SQLITE_CPP/vdbeaux.c \ ! $$SQLITE_CPP/where.c --- 3,45 ---- HEADERS += $$SQLITE_H/btree.h \ ! $$SQLITE_H/config.h \ ! $$SQLITE_H/hash.h \ ! $$SQLITE_H/opcodes.h \ ! $$SQLITE_H/os.h \ ! $$SQLITE_H/pager.h \ ! $$SQLITE_H/parse.h \ ! $$SQLITE_H/sqlite.h \ ! $$SQLITE_H/sqliteInt.h \ ! $$SQLITE_H/vdbe.h \ ! $$SQLITE_H/vdbeInt.h ! SOURCES += $$SQLITE_CPP/attach.c \ ! $$SQLITE_CPP/auth.c \ ! $$SQLITE_CPP/btree.c \ ! $$SQLITE_CPP/btree_rb.c \ ! $$SQLITE_CPP/build.c \ ! $$SQLITE_CPP/copy.c \ ! $$SQLITE_CPP/date.c \ ! $$SQLITE_CPP/delete.c \ ! $$SQLITE_CPP/expr.c \ ! $$SQLITE_CPP/func.c \ ! $$SQLITE_CPP/hash.c \ ! $$SQLITE_CPP/insert.c \ ! $$SQLITE_CPP/main.c \ ! $$SQLITE_CPP/opcodes.c \ ! $$SQLITE_CPP/os.c \ ! $$SQLITE_CPP/pager.c \ ! $$SQLITE_CPP/parse.c \ ! $$SQLITE_CPP/pragma.c \ ! $$SQLITE_CPP/printf.c \ ! $$SQLITE_CPP/random.c \ ! $$SQLITE_CPP/select.c \ ! $$SQLITE_CPP/table.c \ ! $$SQLITE_CPP/tokenize.c \ ! $$SQLITE_CPP/trigger.c \ ! $$SQLITE_CPP/update.c \ ! $$SQLITE_CPP/util.c \ ! $$SQLITE_CPP/vacuum.c \ ! $$SQLITE_CPP/vdbe.c \ ! $$SQLITE_CPP/vdbeaux.c \ ! $$SQLITE_CPP/where.c |