Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26712
Modified Files:
coord.cpp gumps.cpp spawnregions.cpp spawnregions.h
Log Message:
Spawnregion updates
Index: spawnregions.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/spawnregions.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** spawnregions.h 2 Oct 2004 22:22:57 -0000 1.32
--- spawnregions.h 13 Oct 2004 14:45:20 -0000 1.33
***************
*** 109,112 ****
--- 109,116 ----
}
+ inline void setActive(bool value) {
+ active_ = value;
+ }
+
inline unsigned int nextTime() {
return nextTime_;
Index: spawnregions.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/spawnregions.cpp,v
retrieving revision 1.79
retrieving revision 1.80
diff -C2 -d -r1.79 -r1.80
*** spawnregions.cpp 12 Oct 2004 23:59:28 -0000 1.79
--- spawnregions.cpp 13 Oct 2004 14:45:20 -0000 1.80
***************
*** 656,667 ****
void cSpawnRegion::onSpawn( cUObject* obj )
{
! cPythonScript* global = ScriptManager::instance()->getGlobalHook( EVENT_CREATE );
! if ( global )
! {
PyObject* args = Py_BuildValue( "NN", PyGetSpawnRegionObject( this ), PyGetObjectObject( obj ) );
-
global->callEventHandler( EVENT_SPAWN, args );
-
Py_DECREF( args );
}
--- 656,664 ----
void cSpawnRegion::onSpawn( cUObject* obj )
{
! cPythonScript* global = ScriptManager::instance()->getGlobalHook( EVENT_SPAWN );
! if ( global ) {
PyObject* args = Py_BuildValue( "NN", PyGetSpawnRegionObject( this ), PyGetObjectObject( obj ) );
global->callEventHandler( EVENT_SPAWN, args );
Py_DECREF( args );
}
***************
*** 671,684 ****
void cSpawnRegion::reSpawn( void )
{
! unsigned int i = 0;
! for ( i = 0; i < npcsPerCycle_; ++i )
! if ( npcs() < maxNpcAmt_ )
! spawnSingleNPC(); // spawn a random npc
! for ( i = 0; i < this->itemsPerCycle_; i++ )
! if ( items() < this->maxItemAmt_ )
! spawnSingleItem(); // spawn a random item
! this->nextTime_ = Server::instance()->time() + RandomNum( this->minTime_, this->maxTime_ ) * MY_CLOCKS_PER_SEC;
}
--- 668,683 ----
void cSpawnRegion::reSpawn( void )
{
! if (active_) {
! unsigned int i = 0;
! for ( i = 0; i < npcsPerCycle_; ++i )
! if ( npcs() < maxNpcAmt_ )
! spawnSingleNPC(); // spawn a random npc
! for ( i = 0; i < this->itemsPerCycle_; i++ )
! if ( items() < this->maxItemAmt_ )
! spawnSingleItem(); // spawn a random item
! this->nextTime_ = Server::instance()->time() + RandomNum( this->minTime_, this->maxTime_ ) * MY_CLOCKS_PER_SEC;
! }
}
Index: gumps.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/gumps.cpp,v
retrieving revision 1.173
retrieving revision 1.174
diff -C2 -d -r1.173 -r1.174
*** gumps.cpp 8 Oct 2004 10:57:10 -0000 1.173
--- gumps.cpp 13 Oct 2004 14:45:20 -0000 1.174
***************
*** 140,143 ****
--- 140,149 ----
addText( 50, 140, tr( "NPCs: %1 of %2" ).arg( region->npcs() ).arg( region->maxNpcs() ), 0x834 );
addText( 50, 160, tr( "Items: %1 of %2" ).arg( region->items() ).arg( region->maxItems() ), 0x834 );
+ if (region->active()) {
+ addText( 50, 180, tr( "Active" ), 0x834 );
+ } else {
+ addText( 50, 180, tr( "Inactive" ), 0x834 );
+ }
+ addText( 50, 200, tr( "Groups: %1" ).arg(region->groups().join(", ")), 0x834 );
//addText( 50, 180, tr( "Coordinates: %1" ).arg( allrectangles.size() ), 0x834 );
Index: coord.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/coord.cpp,v
retrieving revision 1.63
retrieving revision 1.64
diff -C2 -d -r1.63 -r1.64
*** coord.cpp 16 Sep 2004 18:46:33 -0000 1.63
--- coord.cpp 13 Oct 2004 14:45:20 -0000 1.64
***************
*** 148,152 ****
for (P_ITEM ditem = ditems->first(); ditem; ditem = ditems->next()) {
// If the item is invisible or a multi, skip past it.
! if (ditem->visible() != 0 || ditem->isMulti()) {
continue;
}
--- 148,152 ----
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;
}
|