Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24425
Modified Files:
config.cpp config.h spawnregions.cpp speech.cpp
Log Message:
Several fixes
Index: config.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/config.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** config.h 2 Jun 2004 15:04:04 -0000 1.5
--- config.h 18 Jul 2004 21:02:58 -0000 1.6
***************
*** 89,92 ****
--- 89,93 ----
bool guardsActive_;
bool saveSpawns_;
+ bool dontStackSpawnedObjects_;
bool autoAccountCreate_;
float checkNPCTime_;
***************
*** 221,224 ****
--- 222,229 ----
unsigned int tamedDisappear() const;
unsigned int houseInTown() const;
+ inline bool dontStackSpawnedObjects() const {
+ return dontStackSpawnedObjects_;
+ }
+
unsigned int shopRestock() const;
unsigned int snoopdelay() const;
Index: speech.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/speech.cpp,v
retrieving revision 1.178
retrieving revision 1.179
diff -C2 -d -r1.178 -r1.179
*** speech.cpp 11 Jul 2004 19:04:58 -0000 1.178
--- speech.cpp 18 Jul 2004 21:02:58 -0000 1.179
***************
*** 338,341 ****
--- 338,345 ----
return; // Vendor responded already
+ // this makes it so npcs do not respond to isDead people - HEALERS ??
+ if ( pChar->isDead() )
+ return;
+
// 0x0007 -> Speech-id for "Guards"
for ( QValueVector<UINT16>::const_iterator iter = keywords.begin(); iter != keywords.end(); ++iter )
***************
*** 343,354 ****
UINT16 keyword = *iter;
! if ( keyword == 0x07 )
pChar->callGuards();
}
- // this makes it so npcs do not respond to isDead people - HEALERS ??
- if ( pChar->isDead() )
- return;
-
/* P_CHAR pc = NULL; ???
P_CHAR pNpc = NULL;
--- 347,354 ----
UINT16 keyword = *iter;
! if (keyword == 0x07)
pChar->callGuards();
}
/* P_CHAR pc = NULL; ???
P_CHAR pNpc = NULL;
Index: spawnregions.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/spawnregions.cpp,v
retrieving revision 1.61
retrieving revision 1.62
diff -C2 -d -r1.61 -r1.62
*** spawnregions.cpp 3 Jun 2004 14:42:59 -0000 1.61
--- spawnregions.cpp 18 Jul 2004 21:02:58 -0000 1.62
***************
*** 38,41 ****
--- 38,43 ----
#include "basics.h"
#include "console.h"
+ #include "sectors.h"
+ #include "config.h"
using namespace std;
***************
*** 201,209 ****
}
! bool cSpawnRegion::findValidSpot( Coord_cl& pos )
! {
! UI32 i = 0;
! while ( i < 100 )
! {
int rndRectNum = RandomNum( 0, this->rectangles_.size() - 1 );
pos.x = RandomNum( this->rectangles_[rndRectNum].x1, this->rectangles_[rndRectNum].x2 );
--- 203,209 ----
}
! bool cSpawnRegion::findValidSpot(Coord_cl& pos) {
! // Try up to 100 times.
! for(unsigned int i = 0; i < 100; ++i) {
int rndRectNum = RandomNum( 0, this->rectangles_.size() - 1 );
pos.x = RandomNum( this->rectangles_[rndRectNum].x1, this->rectangles_[rndRectNum].x2 );
***************
*** 216,222 ****
pos.map = rectangles_[rndRectNum].map;
! if ( Movement::instance()->canLandMonsterMoveHere( pos ) )
! return true;
! i++;
}
--- 216,243 ----
pos.map = rectangles_[rndRectNum].map;
! if (Movement::instance()->canLandMonsterMoveHere(pos)) {
! if (!Config::instance()->dontStackSpawnedObjects()) {
! return true;
! }
!
! // Check if there are spawned items or npcs at the position.
! cCharSectorIterator *chariterator = SectorMaps::instance()->findChars(pos, 0);
!
! P_CHAR pChar;
! for (pChar = chariterator->first(); pChar; pChar = chariterator->next()) {
! if (pChar->spawnregion()) {
! continue;
! }
! }
!
! cItemSectorIterator *itemiterator = SectorMaps::instance()->findItems(pos, 0);
!
! P_ITEM pItem;
! for (pItem = itemiterator->first(); pItem; pItem = itemiterator->next()) {
! if (pItem->spawnregion()) {
! continue;
! }
! }
! }
}
Index: config.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/config.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** config.cpp 2 Jun 2004 15:04:04 -0000 1.6
--- config.cpp 18 Jul 2004 21:02:58 -0000 1.7
***************
*** 164,167 ****
--- 164,168 ----
logMask_ = getNumber( "General", "Logging Mask", LOG_ALL, true );
overwriteDefinitions_ = getBool( "General", "Overwrite Definitions", false, true );
+ dontStackSpawnedObjects_ = getBool("General", "Don't Stack Spawned Objects", true, true);
saveInterval_ = getNumber( "General", "Save Interval", 900, true );
|