Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26485
Modified Files:
npc.cpp world.cpp
Log Message:
Fixes from spddwn.
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.119
retrieving revision 1.120
diff -C2 -d -r1.119 -r1.120
*** world.cpp 27 Aug 2004 23:58:53 -0000 1.119
--- world.cpp 31 Aug 2004 22:04:39 -0000 1.120
***************
*** 421,424 ****
--- 421,427 ----
void cWorld::load()
{
+ unsigned int loadStart = getNormalizedTime();
+ QPtrList<PersistentObject> objects;
+
if ( Config::instance()->databaseDriver() == "binary" )
{
***************
*** 439,445 ****
unsigned int lastpercent = 0;
unsigned int percent = 0;
- unsigned int loadStart = getNormalizedTime();
- QPtrList<PersistentObject> objects;
-
do
{
--- 442,445 ----
***************
*** 522,536 ****
while ( type != 0xFF );
reader.close();
-
- QPtrList<PersistentObject>::const_iterator cit(objects.begin());
- while (cit != objects.end()) {
- (*cit)->postload(reader.version());
- ++cit;
- }
-
- unsigned int duration = getNormalizedTime() - loadStart;
-
- Console::instance()->send( "\b\b\b\b" ); // 100%
- Console::instance()->log( LOG_MESSAGE, QString( "The world loaded in %1 ms.\n" ).arg( duration ) );
}
}
--- 522,525 ----
***************
*** 608,611 ****
--- 597,601 ----
object = PersistentFactory::instance()->createObject( type );
object->load( row, offset );
+ objects.append(object);
++progress;
***************
*** 759,762 ****
--- 749,753 ----
pChar->flagUnchanged(); // We've just loaded, nothing changes
}
+
if ( deleteItems.count() > 0 )
***************
*** 769,773 ****
deleteItems.clear();
}
!
// Load SpawnRegion information
cDBResult result = PersistentBroker::instance()->query( "SELECT spawnregion,serial FROM spawnregions;" );
--- 760,764 ----
deleteItems.clear();
}
!
// Load SpawnRegion information
cDBResult result = PersistentBroker::instance()->query( "SELECT spawnregion,serial FROM spawnregions;" );
***************
*** 798,803 ****
PersistentBroker::instance()->disconnect();
- Console::instance()->send( "Finished loading the world.\n" );
}
cComponent::load();
--- 789,806 ----
PersistentBroker::instance()->disconnect();
}
+
+ // post process all loaded objects
+ QPtrList<PersistentObject>::const_iterator cit(objects.begin());
+
+ while (cit != objects.end()) {
+ (*cit)->postload(0);
+ ++cit;
+ }
+
+ unsigned int duration = getNormalizedTime() - loadStart;
+
+ Console::instance()->send( "\n\b\b\b\b" ); // 100%
+ Console::instance()->log( LOG_MESSAGE, QString( "\nThe world loaded in %1 ms.\n" ).arg( duration ) );
cComponent::load();
***************
*** 1448,1450 ****
return ( p->it++ )->second;
! }
--- 1451,1453 ----
return ( p->it++ )->second;
! }
\ No newline at end of file
Index: npc.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v
retrieving revision 1.110
retrieving revision 1.111
diff -C2 -d -r1.110 -r1.111
*** npc.cpp 29 Aug 2004 20:40:50 -0000 1.110
--- npc.cpp 31 Aug 2004 22:04:39 -0000 1.111
***************
*** 56,59 ****
--- 56,60 ----
cNPC::cNPC()
{
+ setWanderFollowTarget(0);
nextMsgTime_ = 0;
nextGuardCallTime_ = 0;
***************
*** 110,113 ****
--- 111,116 ----
owner_ = 0;
setOwner( dynamic_cast<P_PLAYER>( World::instance()->findChar( owner ) ) );
+ if ( wanderType() == enFollowTarget )
+ setWanderType( enFreely );
}
***************
*** 905,909 ****
}
else
! ret = Coord_cl( 0xFFFF, 0xFFFF, 0xFF, 0 );
return ret;
--- 908,912 ----
}
else
! ret = Coord_cl( 0xFFFF, 0xFFFF, (SI08) 0xFF, 0 );
return ret;
***************
*** 938,942 ****
{
if ( path_.empty() )
! return Coord_cl( 0xFFFF, 0xFFFF, 0xFF, 0 );
else
return path_.back();
--- 941,945 ----
{
if ( path_.empty() )
! return Coord_cl( 0xFFFF, 0xFFFF, (SI08) 0xFF, 0 );
else
return path_.back();
***************
*** 1452,1454 ****
unsigned int cNPC::maxWeight() {
return 0;
! }
--- 1455,1457 ----
unsigned int cNPC::maxWeight() {
return 0;
! }
\ No newline at end of file
|