Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27343
Modified Files:
basechar.cpp basechar.h basedef.cpp basedef.h items.cpp
npc.cpp server.cpp
Log Message:
bodytype property.
Index: server.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/server.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** server.cpp 4 Sep 2004 21:20:07 -0000 1.21
--- server.cpp 14 Sep 2004 00:00:38 -0000 1.22
***************
*** 155,172 ****
{
d->actionMutex.lock();
! while ( d->actionQueue.begin() != d->actionQueue.end() )
! {
! cAction *action = *(d->actionQueue.begin());
! d->actionQueue.erase(d->actionQueue.begin());
!
! try {
! action->execute();
! } catch ( wpException e ) {
! Console::instance()->log( LOG_PYTHON, e.error() + "\n" );
! }
! delete action;
}
! d->actionMutex.unlock();
}
}
--- 155,169 ----
{
d->actionMutex.lock();
! cAction *action = *(d->actionQueue.begin());
! d->actionQueue.erase(d->actionQueue.begin());
! d->actionMutex.unlock();
! try {
! action->execute();
! } catch ( wpException e ) {
! Console::instance()->log( LOG_PYTHON, e.error() + "\n" );
}
!
! delete action;
}
}
Index: basedef.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basedef.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** basedef.cpp 9 Sep 2004 05:52:47 -0000 1.18
--- basedef.cpp 14 Sep 2004 00:00:37 -0000 1.19
***************
*** 289,292 ****
--- 289,304 ----
}
+ // The offset for sounds this creature is using
+ QString bodytype = hex2dec(element.attribute("type"));
+ if (!bodytype.isNull()) {
+ bodyinfo.type = bodytype.toUShort(&ok);
+ if (!ok) {
+ Console::instance()->log(LOG_WARNING, QString("Invalid bodytype in bodyinfo file: %1.\n").arg(bodytype));
+ continue;
+ }
+ } else {
+ bodyinfo.type = 0;
+ }
+
if (bodyinfo.body < 0x400) {
this->bodyinfo[bodyinfo.body] = bodyinfo;
Index: basedef.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basedef.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** basedef.h 9 Sep 2004 05:52:47 -0000 1.16
--- basedef.h 14 Sep 2004 00:00:37 -0000 1.17
***************
*** 195,198 ****
--- 195,205 ----
};
+ #define BODY_UNKNOWN 0
+ #define BODY_MONSTER 1
+ #define BODY_SEA 2
+ #define BODY_ANIMAL 3
+ #define BODY_HUMAN 4
+ #define BODY_EQUIPMENT 5
+
struct stBodyInfo {
unsigned short body;
***************
*** 201,204 ****
--- 208,212 ----
unsigned char flags;
unsigned char soundmode;
+ unsigned char type;
};
Index: basechar.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v
retrieving revision 1.145
retrieving revision 1.146
diff -C2 -d -r1.145 -r1.146
*** basechar.cpp 6 Sep 2004 22:31:24 -0000 1.145
--- basechar.cpp 14 Sep 2004 00:00:36 -0000 1.146
***************
*** 512,515 ****
--- 512,521 ----
void cBaseChar::action( unsigned char id, unsigned char speed, bool reverse )
{
+ if (isAntiBlink()) {
+ if (id == ANIM_CAST_DIR) {
+ id = ANIM_CAST_AREA;
+ }
+ }
+
bool mounted = atLayer( Mount ) != 0;
***************
*** 1979,1982 ****
--- 1985,1998 ----
*/
PY_PROPERTY( "stepstaken", stepsTaken() )
+ /*
+ \rproperty char.bodytype The type of this characters bodies.
+ <code>0 - Unknown
+ 1 Monster
+ 2 Sea
+ 3 Animal
+ 4 Human
+ 5 Equipment</code>
+ */
+ PY_PROPERTY( "bodytype", bodytype() )
PY_PROPERTY( "orgname", orgName_ )
PY_PROPERTY( "direction", direction_ )
Index: basechar.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.h,v
retrieving revision 1.84
retrieving revision 1.85
diff -C2 -d -r1.84 -r1.85
*** basechar.h 9 Sep 2004 05:52:47 -0000 1.84
--- basechar.h 14 Sep 2004 00:00:36 -0000 1.85
***************
*** 547,550 ****
--- 547,555 ----
}
+ inline unsigned char bodytype()
+ {
+ return CharBaseDefs::instance()->getBodyInfo(body()).type;
+ }
+
inline unsigned char soundmode()
{
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.446
retrieving revision 1.447
diff -C2 -d -r1.446 -r1.447
*** items.cpp 7 Sep 2004 23:01:49 -0000 1.446
--- items.cpp 14 Sep 2004 00:00:37 -0000 1.447
***************
*** 860,868 ****
{
cItem* nItem = cItem::createFromScript( element->getAttribute( "id" ) );
! addItem( nItem );
! for ( unsigned int j = 0; j < element->childCount(); ++j )
! nItem->processNode( element->getChild( j ) );
! if ( this->layer() == cBaseChar::BuyRestockContainer )
! nItem->setRestock( nItem->amount() );
}
else if ( element->hasAttribute( "list" ) )
--- 860,870 ----
{
cItem* nItem = cItem::createFromScript( element->getAttribute( "id" ) );
! if (nItem) {
! addItem( nItem );
! for ( unsigned int j = 0; j < element->childCount(); ++j )
! nItem->processNode( element->getChild( j ) );
! if ( this->layer() == cBaseChar::BuyRestockContainer )
! nItem->setRestock( nItem->amount() );
! }
}
else if ( element->hasAttribute( "list" ) )
Index: npc.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v
retrieving revision 1.113
retrieving revision 1.114
diff -C2 -d -r1.113 -r1.114
*** npc.cpp 8 Sep 2004 03:23:33 -0000 1.113
--- npc.cpp 14 Sep 2004 00:00:38 -0000 1.114
***************
*** 902,911 ****
{
Coord_cl ret;
! if ( !path_.empty() )
{
! ret = path_.front();
}
else
ret = Coord_cl( 0xFFFF, 0xFFFF, (SI08) 0xFF, 0 );
return ret;
--- 902,915 ----
{
Coord_cl ret;
! std::deque<Coord_cl>::const_iterator it = path_.begin();
!
! if (it != path_.end())
{
! ret = *it;
}
else
+ {
ret = Coord_cl( 0xFFFF, 0xFFFF, (SI08) 0xFF, 0 );
+ }
return ret;
***************
*** 934,942 ****
bool cNPC::hasPath( void )
{
! return !path_.empty();
}
Coord_cl cNPC::pathDestination( void ) const
{
if ( path_.empty() )
return Coord_cl( 0xFFFF, 0xFFFF, (SI08) 0xFF, 0 );
--- 938,948 ----
bool cNPC::hasPath( void )
{
! std::deque<Coord_cl>::const_iterator it = path_.begin();
! return it != path_.end();
}
Coord_cl cNPC::pathDestination( void ) const
{
+
if ( path_.empty() )
return Coord_cl( 0xFFFF, 0xFFFF, (SI08) 0xFF, 0 );
|