Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12824
Modified Files:
basechar.cpp basechar.h dragdrop.cpp items.cpp items.h
multi.cpp npc.cpp player.cpp player.h timers.cpp timers.h
trade.cpp
Log Message:
fix bug 210 ( onCreate issue, Items )
also, contains several API fixes to conform the coding standard.
Index: player.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.h,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -d -r1.53 -r1.54
*** player.h 10 Aug 2004 03:15:57 -0000 1.53
--- player.h 12 Aug 2004 03:02:51 -0000 1.54
***************
*** 102,107 ****
virtual stError* setProperty( const QString& name, const cVariant& value );
PyObject* getProperty( const QString& name );
- void turnTo( cUObject* object ); // override
- void turnTo( const Coord_cl& data ); // override
P_NPC unmount();
void mount( P_NPC pMount );
--- 102,105 ----
***************
*** 111,115 ****
void makeCriminal();
void disturbMed();
! int CountBankGold();
bool canPickUp( cItem* pi );
virtual bool inWorld();
--- 109,113 ----
void makeCriminal();
void disturbMed();
! int countBankGold();
bool canPickUp( cItem* pi );
virtual bool inWorld();
Index: trade.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/trade.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** trade.cpp 10 Aug 2004 03:15:57 -0000 1.6
--- trade.cpp 12 Aug 2004 03:02:51 -0000 1.7
***************
*** 94,98 ****
}
! P_ITEM pStock = pVendor->GetItemOnLayer( 0x1A );
cItem::ContainerContent sContent;
--- 94,98 ----
}
! P_ITEM pStock = pVendor->getItemOnLayer( 0x1A );
cItem::ContainerContent sContent;
***************
*** 100,104 ****
sContent = pStock->content();
! P_ITEM pBought = pVendor->GetItemOnLayer( 0x1B );
cItem::ContainerContent bContent;
--- 100,104 ----
sContent = pStock->content();
! P_ITEM pBought = pVendor->getItemOnLayer( 0x1B );
cItem::ContainerContent bContent;
***************
*** 172,177 ****
// Get our total gold at once
! UINT32 bankGold = pChar->CountBankGold();
! UINT32 packGold = pChar->CountGold();
bool fromBank;
--- 172,177 ----
// Get our total gold at once
! UINT32 bankGold = pChar->countBankGold();
! UINT32 packGold = pChar->countGold();
bool fromBank;
***************
*** 279,283 ****
}
! P_ITEM pPurchase = pVendor->GetItemOnLayer( 0x1C );
if ( !pPurchase )
{
--- 279,283 ----
}
! P_ITEM pPurchase = pVendor->getItemOnLayer( 0x1C );
if ( !pPurchase )
{
Index: dragdrop.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dragdrop.cpp,v
retrieving revision 1.239
retrieving revision 1.240
diff -C2 -d -r1.239 -r1.240
*** dragdrop.cpp 10 Aug 2004 03:15:56 -0000 1.239
--- dragdrop.cpp 12 Aug 2004 03:02:50 -0000 1.240
***************
*** 125,129 ****
bool sameGuild = true;//( GuildCompare( pChar, outmostCont->owner() ) != 0 );
! if ( outmostCont->hasTag( "notoriety" ) && outmostCont->getTag( "notoriety" ).toInt() == 1 && !pChar->Owns( outmostCont ) && !sameGuild )
{
// pChar->karma -= 5;
--- 125,129 ----
bool sameGuild = true;//( GuildCompare( pChar, outmostCont->owner() ) != 0 );
! if ( outmostCont->hasTag( "notoriety" ) && outmostCont->getTag( "notoriety" ).toInt() == 1 && !pChar->owns( outmostCont ) && !sameGuild )
{
// pChar->karma -= 5;
Index: basechar.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v
retrieving revision 1.125
retrieving revision 1.126
diff -C2 -d -r1.125 -r1.126
*** basechar.cpp 10 Aug 2004 03:15:56 -0000 1.125
--- basechar.cpp 12 Aug 2004 03:02:50 -0000 1.126
***************
*** 679,683 ****
{
changed_ = true;
! cItem* pHair = GetItemOnLayer( 11 );
if ( pHair )
pHair->setColor( d );
--- 679,683 ----
{
changed_ = true;
! cItem* pHair = getItemOnLayer( 11 );
if ( pHair )
pHair->setColor( d );
***************
*** 690,694 ****
return;
changed_ = true;
! cItem* pHair = GetItemOnLayer( 11 );
if ( pHair )
{
--- 690,694 ----
return;
changed_ = true;
! cItem* pHair = getItemOnLayer( 11 );
if ( pHair )
{
***************
*** 711,715 ****
{
changed_ = true;
! cItem* pBeard = GetItemOnLayer( 16 );
if ( pBeard )
pBeard->setColor( d );
--- 711,715 ----
{
changed_ = true;
! cItem* pBeard = getItemOnLayer( 16 );
if ( pBeard )
pBeard->setColor( d );
***************
*** 722,726 ****
return;
changed_ = true;
! cItem* pBeard = GetItemOnLayer( 16 );
if ( pBeard )
pBeard->setId( d );
--- 722,726 ----
return;
changed_ = true;
! cItem* pBeard = getItemOnLayer( 16 );
if ( pBeard )
pBeard->setId( d );
***************
*** 973,983 ****
}
! int cBaseChar::CountItems( short ID, short col )
{
// Dont you think it's better to search the char's equipment as well?
UINT32 number = 0;
! ItemContainer container = content_;
! ItemContainer::const_iterator it = container.begin();
! ItemContainer::const_iterator end = container.end();
for ( ; it != end; ++it )
--- 973,982 ----
}
! int cBaseChar::countItems( short ID, short col )
{
// Dont you think it's better to search the char's equipment as well?
UINT32 number = 0;
! ItemContainer::const_iterator it(content_.begin());
! ItemContainer::const_iterator end(content_.end());
for ( ; it != end; ++it )
***************
*** 995,1008 ****
if ( pi )
! number = pi->CountItems( ID, col );
return number;
}
! int cBaseChar::CountGold()
{
! return CountItems( 0x0EED );
}
! P_ITEM cBaseChar::GetItemOnLayer( unsigned char layer )
{
return atLayer( static_cast<enLayer>( layer ) );
--- 994,1007 ----
if ( pi )
! number = pi->countItems( ID, col );
return number;
}
! int cBaseChar::countGold()
{
! return countItems( 0x0EED );
}
! P_ITEM cBaseChar::getItemOnLayer( unsigned char layer )
{
return atLayer( static_cast<enLayer>( layer ) );
***************
*** 1053,1062 ****
}
! void cBaseChar::MoveTo( short newx, short newy, signed char newz )
! {
! cUObject::moveTo( Coord_cl( newx, newy, newz, pos().map ) );
! }
!
! bool cBaseChar::Wears( P_ITEM pi )
{
return ( this == pi->container() );
--- 1052,1056 ----
}
! bool cBaseChar::wears( P_ITEM pi )
{
return ( this == pi->container() );
***************
*** 1157,1161 ****
}
! bool cBaseChar::Owns( P_ITEM pItem ) const
{
if ( !pItem )
--- 1151,1155 ----
}
! bool cBaseChar::owns( P_ITEM pItem ) const
{
if ( !pItem )
***************
*** 2853,2857 ****
for ( unsigned char layer = SingleHandedWeapon; layer <= InnerLegs; ++layer )
{
! P_ITEM item = GetItemOnLayer( layer );
if ( item )
--- 2847,2851 ----
for ( unsigned char layer = SingleHandedWeapon; layer <= InnerLegs; ++layer )
{
! P_ITEM item = getItemOnLayer( layer );
if ( item )
Index: timers.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/timers.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** timers.h 19 Jun 2004 02:06:51 -0000 1.4
--- timers.h 12 Aug 2004 03:02:51 -0000 1.5
***************
*** 161,164 ****
--- 161,177 ----
};
+ class cDelayedOnCreateCall : public cTimer
+ {
+ cUObject* obj_;
+ const QString def_;
+ public:
+ cDelayedOnCreateCall( cUObject*, const QString& definition );
+ void Expire();
+ QString objectID() const
+ {
+ return "cDelayedOnCreateCall";
+ }
+ };
+
class cTimers
{
Index: timers.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/timers.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** timers.cpp 10 Aug 2004 03:15:57 -0000 1.7
--- timers.cpp 12 Aug 2004 03:02:51 -0000 1.8
***************
*** 465,468 ****
--- 465,480 ----
}
+ cDelayedOnCreateCall::cDelayedOnCreateCall( cUObject* obj, const QString& definition ) :
+ obj_(obj), def_(definition)
+ {
+ setSerializable( false );
+ expiretime = 0; // right on the next loop.
+ }
+
+ void cDelayedOnCreateCall::Expire()
+ {
+ obj_->onCreate(def_);
+ }
+
void cTimers::insert( cTimer* pT )
{
Index: multi.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/multi.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** multi.cpp 10 Aug 2004 03:15:57 -0000 1.12
--- multi.cpp 12 Aug 2004 03:02:50 -0000 1.13
***************
*** 34,37 ****
--- 34,38 ----
#include "console.h"
#include "sectors.h"
+ #include "timers.h"
void cMulti::remove()
***************
*** 93,97 ****
multi->setBaseid( id.latin1() );
multi->applyDefinition( section );
! multi->onCreate( id );
}
else
--- 94,99 ----
multi->setBaseid( id.latin1() );
multi->applyDefinition( section );
! cDelayedOnCreateCall* onCreateCall = new cDelayedOnCreateCall( multi, id );
! Timers::instance()->insert( onCreateCall );
}
else
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.430
retrieving revision 1.431
diff -C2 -d -r1.430 -r1.431
*** items.cpp 10 Aug 2004 03:15:57 -0000 1.430
--- items.cpp 12 Aug 2004 03:02:50 -0000 1.431
***************
*** 292,300 ****
}
- void cItem::MoveTo( int newx, int newy, signed char newz )
- {
- moveTo( Coord_cl( newx, newy, newz, pos().z, pos().map ) );
- }
-
/*
* Author: LB purpose: returns the type of pack
--- 292,295 ----
***************
*** 310,405 ****
* 40 .. 140 for 4
*/
! short cItem::GetContGumpType()
{
switch ( id() )
{
case 0x09a8:
- return 1;
- case 0x09a9:
- return 2;
case 0x09aa:
- return 1;
- case 0x09ab:
- return 3;
case 0x09b0:
return 1;
- case 0x09b2:
- return 4;
-
- case 0x0A2C:
- return 1; // chest of drawers
- case 0x0A30:
- return 1; // chest of drawers
- case 0x0A34:
- return 1; // chest of drawers
- case 0x0A38:
- return 1; // chest of drawers
-
- case 0x0A4D:
- return 1; // armoire
- case 0x0A4F:
- return 1; // armoire
- case 0x0A51:
- return 1; // armoire
- case 0x0A53:
- return 1; // armoire
-
- case 0x0A97:
- return 1; // bookshelf
- case 0x0A98:
- return 1; // bookshelf
- case 0x0A99:
- return 1; // bookshelf
- case 0x0A9A:
- return 1; // bookshelf
- case 0x0A9B:
- return 1; // bookshelf
- case 0x0A9C:
- return 1; // bookshelf
- case 0x0A9D:
- return 1; // bookshelf
- case 0x0A9E:
- return 1; // bookshelf
case 0x0e3c:
- return 2;
case 0x0e3d:
- return 2;
case 0x0e3e:
- return 2;
case 0x0e3f:
return 2;
case 0x0e40:
- return 3;
case 0x0e41:
- return 3;
case 0x0e42:
- return 3;
case 0x0e43:
return 3;
- case 0x0e75:
- return 4;
! case 0x0e76:
! return 1;
case 0x0e77:
- return 4;
- case 0x0e78:
- return 2;
- case 0x0e79:
- return 1;
- case 0x0e7a:
- return 1;
-
- case 0x0e7c:
- return 3;
- case 0x0e7d:
- return 1;
- case 0x0e7e:
- return 2;
case 0x0e7f:
- return 4;
- case 0x0e80:
- return 1;
case 0x0e83:
return 4;
--- 305,359 ----
* 40 .. 140 for 4
*/
! short cItem::containerGumpType() const
{
switch ( id() )
{
case 0x09a8:
case 0x09aa:
case 0x09b0:
+ case 0x0A2C: // chest of drawers
+ case 0x0A30: // chest of drawers
+ case 0x0A34: // chest of drawers
+ case 0x0A38: // chest of drawers
+ case 0x0A4D: // armoire
+ case 0x0A4F: // armoire
+ case 0x0A51: // armoire
+ case 0x0A53: // armoire
+ case 0x0A97: // bookshelf
+ case 0x0A98: // bookshelf
+ case 0x0A99: // bookshelf
+ case 0x0A9A: // bookshelf
+ case 0x0A9B: // bookshelf
+ case 0x0A9C: // bookshelf
+ case 0x0A9D: // bookshelf
+ case 0x0A9E: // bookshelf
+ case 0x0e76:
+ case 0x0e79:
+ case 0x0e7a:
+ case 0x0e7d:
+ case 0x0e80:
return 1;
+ case 0x09a9:
case 0x0e3c:
case 0x0e3d:
case 0x0e3e:
case 0x0e3f:
+ case 0x0e78:
+ case 0x0e7e:
return 2;
+
+ case 0x09ab:
case 0x0e40:
case 0x0e41:
case 0x0e42:
case 0x0e43:
+ case 0x0e7c:
return 3;
! case 0x09b2:
! case 0x0e75:
case 0x0e77:
case 0x0e7f:
case 0x0e83:
return 4;
***************
*** 407,410 ****
--- 361,365 ----
case 0x2006:
return 5; // a corpse/coffin
+
default:
return -1;
***************
*** 412,416 ****
}
! bool cItem::PileItem( cItem* pItem )
{
if ( !canStack( pItem ) )
--- 367,371 ----
}
! bool cItem::pileItem( cItem* pItem )
{
if ( !canStack( pItem ) )
***************
*** 433,438 ****
}
! // try to find an item in the container to stack with
! bool cItem::ContainerPileItem( cItem* pItem )
{
cItem::ContainerContent::const_iterator it( content_.begin() );
--- 388,395 ----
}
! /*!
! Tries to find an item in the container to stack with
! */
! bool cItem::containerPileItem( cItem* pItem )
{
cItem::ContainerContent::const_iterator it( content_.begin() );
***************
*** 440,444 ****
for ( ; it != end; ++it )
{
! if ( ( *it )->PileItem( pItem ) )
return true;
}
--- 397,401 ----
for ( ; it != end; ++it )
{
! if ( ( *it )->pileItem( pItem ) )
return true;
}
***************
*** 446,452 ****
}
! void cItem::SetRandPosInCont( cItem* pCont )
{
! int k = pCont->GetContGumpType();
Coord_cl position = pos();
position.x = RandomNum( 18, 118 );
--- 403,409 ----
}
! void cItem::setRandPosInCont( cItem* pCont )
{
! int k = pCont->containerGumpType();
Coord_cl position = pos();
position.x = RandomNum( 18, 118 );
***************
*** 478,501 ****
}
- int cItem::CountItems( short id, short color ) const
- {
- int total = 0;
- QPtrList<cItem> content = getContainment();
-
- for ( P_ITEM pi = content.first(); pi; pi = content.next() )
- {
- if ( !pi || pi->free ) // just to be sure ;-)
- continue;
- if ( pi->id() == id && ( color == -1 || pi->color() == color ) )
- total += pi->amount();
- }
- return total;
- }
-
/*!
Recurses through the container given by serial and deletes items of
the given id and color(if given) until the given amount is reached
*/
! int cItem::DeleteAmount( int amount, unsigned short _id, unsigned short _color )
{
int rest = amount;
--- 435,443 ----
}
/*!
Recurses through the container given by serial and deletes items of
the given id and color(if given) until the given amount is reached
*/
! int cItem::deleteAmount( int amount, unsigned short _id, unsigned short _color )
{
int rest = amount;
***************
*** 508,512 ****
pi = *it;
if ( pi->type() == 1 )
! rest = pi->DeleteAmount( rest, _id, _color );
if ( pi->id() == _id && ( _color == 0 || ( pi->color() == _color ) ) )
rest = pi->reduceAmount( rest );
--- 450,454 ----
pi = *it;
if ( pi->type() == 1 )
! rest = pi->deleteAmount( rest, _id, _color );
if ( pi->id() == _id && ( _color == 0 || ( pi->color() == _color ) ) )
rest = pi->reduceAmount( rest );
***************
*** 1161,1165 ****
flags |= 0x20;
}
! else if ( isOwnerMovable() && player->Owns( this ) )
{
flags |= 0x20;
--- 1103,1107 ----
flags |= 0x20;
}
! else if ( isOwnerMovable() && player->owns( this ) )
{
flags |= 0x20;
***************
*** 1192,1196 ****
flags |= 0x20;
}
! else if ( isOwnerMovable() && player->Owns( this ) )
{
flags |= 0x20;
--- 1134,1138 ----
flags |= 0x20;
}
! else if ( isOwnerMovable() && player->owns( this ) )
{
flags |= 0x20;
***************
*** 1552,1556 ****
}
! void cItem::addItem( cItem* pItem, bool randomPos, bool handleWeight, bool noRemove )
{
if ( !pItem )
--- 1494,1498 ----
}
! void cItem::addItem( cItem* pItem, bool randomPos, bool handleWeight, bool noRemove, bool autoStack )
{
if ( !pItem )
***************
*** 1579,1583 ****
if ( randomPos )
{
! if ( ContainerPileItem( pItem ) )
{
// If the Server is running and this happens, resend the tooltip of us and
--- 1521,1525 ----
if ( randomPos )
{
! if ( autoStack && containerPileItem( pItem ) )
{
// If the Server is running and this happens, resend the tooltip of us and
***************
*** 1598,1602 ****
else
{
! pItem->SetRandPosInCont( this );
}
}
--- 1540,1544 ----
else
{
! pItem->setRandPosInCont( this );
}
}
***************
*** 2173,2177 ****
nItem->setBaseid( id.latin1() );
nItem->applyDefinition( section );
! nItem->onCreate( id );
}
else
--- 2115,2120 ----
nItem->setBaseid( id.latin1() );
nItem->applyDefinition( section );
! cDelayedOnCreateCall* onCreateCall = new cDelayedOnCreateCall( nItem, id );
! Timers::instance()->insert( onCreateCall );
}
else
***************
*** 2274,2278 ****
}
! unsigned int cItem::countItems( const QStringList& baseids )
{
unsigned int count = 0;
--- 2217,2225 ----
}
! /*!
! Counts the items in this container which match a list of
! specific \p baseids.
! */
! unsigned int cItem::countItems( const QStringList& baseids ) const
{
unsigned int count = 0;
***************
*** 2282,2294 ****
}
! ContainerContent::iterator it = content_.begin();
! while ( it != content_.end() )
{
count += ( *it )->countItems( baseids );
- ++it;
}
return count;
}
unsigned int cItem::removeItems( const QStringList& baseids, unsigned int amount )
{
--- 2229,2263 ----
}
! ContainerContent::const_iterator it(content_.begin());
! ContainerContent::const_iterator end(content_.end());
! for ( ; it != end; ++it )
{
count += ( *it )->countItems( baseids );
}
return count;
}
+ unsigned int cItem::countItems( short id, short color ) const
+ {
+ unsigned int total = 0;
+ QPtrList<cItem> content = getContainment();
+
+ for ( P_ITEM pi = content.first(); pi; pi = content.next() )
+ {
+ if ( !pi || pi->free ) // just to be sure ;-)
+ continue;
+ if ( pi->id() == id && ( color == -1 || pi->color() == color ) )
+ total += pi->amount();
+ }
+ return total;
+ }
+
+ /*!
+ \brief Removes a certain amount of items from this container
+ recursively.
+ \param baseids The list of baseids that a item can have.
+ \param amount The amount of items to remove.
+ \returns The remaining amount of items to be removed.
+ */
unsigned int cItem::removeItems( const QStringList& baseids, unsigned int amount )
{
Index: items.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.h,v
retrieving revision 1.209
retrieving revision 1.210
diff -C2 -d -r1.209 -r1.210
*** items.h 10 Aug 2004 03:15:57 -0000 1.209
--- items.h 12 Aug 2004 03:02:50 -0000 1.210
***************
*** 180,183 ****
--- 180,187 ----
public:
+ cItem();
+ cItem( const cItem& src ); // Copy constructor
+
+
unsigned char getClassid()
{
***************
*** 352,357 ****
}
- //***************************END ADDED GETTERS************
-
// Setters
void setId( ushort nValue )
--- 356,359 ----
***************
*** 404,414 ****
{
if ( nValue )
- {
priv_ |= 0x40;
- }
else
- {
priv_ &= ~0x40;
- }
}
--- 406,412 ----
***************
*** 416,423 ****
void setTotalweight( float data );
- cItem();
- cItem( const cItem& src ); // Copy constructor
- static void registerInFactory();
-
bool wearOut(); // The item wears out and true is returned if it's destroyed
void toBackpack( P_CHAR pChar );
--- 414,417 ----
***************
*** 466,500 ****
UINT16 getWeaponSkill();
- void MoveTo( int newx, int newy, signed char newz );
void moveTo( const Coord_cl& pos, bool noremove = false );
long reduceAmount( short amount = 1 );
! short GetContGumpType();
! void SetRandPosInCont( cItem* pCont );
! bool PileItem( cItem* pItem );
! bool ContainerPileItem( cItem* pItem ); // try to find an item in the container to stack with
bool canStack( cItem* pItem ); // See if this item can stack with another.
! void addItem( cItem* pItem, bool randomPos = true, bool handleWeight = true, bool noRemove = false ); // Add Item to container
void removeItem( cItem*, bool handleWeight = true );
void removeFromCont( bool handleWeight = true );
ContainerContent content() const;
bool contains( const cItem* ) const;
! /*!
! \brief Counts the items in this container which match a list of
! specific \p baseids.
! \returns The amount of items found.
! */
! unsigned int countItems( const QStringList& baseids );
- /*!
- \brief Removes a certain amount of items from this container
- recursively.
- \param baseids The list of baseids that a item can have.
- \param amount The amount of items to remove.
- \returns The remaining amount of items to be removed.
- */
unsigned int removeItems( const QStringList& baseids, unsigned int amount );
! int CountItems( short ID, short col = -1 ) const;
! int DeleteAmount( int amount, ushort _id, ushort _color = 0 );
QString getName( bool shortName = false );
void setAllMovable()
--- 460,482 ----
UINT16 getWeaponSkill();
void moveTo( const Coord_cl& pos, bool noremove = false );
long reduceAmount( short amount = 1 );
! short containerGumpType() const;
! void setRandPosInCont( cItem* pCont );
! bool pileItem( cItem* pItem );
! bool containerPileItem( cItem* pItem ); // try to find an item in the container to stack with
bool canStack( cItem* pItem ); // See if this item can stack with another.
! void addItem( cItem* pItem, bool randomPos = true, bool handleWeight = true, bool noRemove = false, bool autoStack = true ); // Add Item to container
void removeItem( cItem*, bool handleWeight = true );
void removeFromCont( bool handleWeight = true );
ContainerContent content() const;
bool contains( const cItem* ) const;
! unsigned int countItems( const QStringList& baseids ) const;
! unsigned int countItems( short ID, short col = -1 ) const;
unsigned int removeItems( const QStringList& baseids, unsigned int amount );
+ void remove();
! int deleteAmount( int amount, ushort _id, ushort _color = 0 );
QString getName( bool shortName = false );
void setAllMovable()
***************
*** 563,567 ****
static P_ITEM createFromList( const QString& list );
static P_ITEM createFromId( unsigned short id );
! void remove();
protected:
--- 545,549 ----
static P_ITEM createFromList( const QString& list );
static P_ITEM createFromId( unsigned short id );
! static void registerInFactory();
protected:
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.117
retrieving revision 1.118
diff -C2 -d -r1.117 -r1.118
*** player.cpp 10 Aug 2004 03:15:57 -0000 1.117
--- player.cpp 12 Aug 2004 03:02:50 -0000 1.118
***************
*** 435,448 ****
}
- void cPlayer::turnTo( cUObject* object )
- {
- cBaseChar::turnTo( object->pos() );
- }
-
- void cPlayer::turnTo( const Coord_cl& pos )
- {
- cBaseChar::turnTo( pos );
- }
-
P_NPC cPlayer::unmount()
{
--- 435,438 ----
***************
*** 691,698 ****
}
! int cPlayer::CountBankGold()
{
P_ITEM pi = getBankbox(); //we want gold bankbox.
! return pi->CountItems( 0x0EED );
}
--- 681,688 ----
}
! int cPlayer::countBankGold()
{
P_ITEM pi = getBankbox(); //we want gold bankbox.
! return pi->countItems( 0x0EED );
}
***************
*** 713,717 ****
}
! if ( ( pi->isOwnerMovable() || pi->isLockedDown() ) && !this->Owns( pi ) ) // owner movable or locked down ?
return false;
--- 703,707 ----
}
! if ( ( pi->isOwnerMovable() || pi->isLockedDown() ) && !this->owns( pi ) ) // owner movable or locked down ?
return false;
***************
*** 780,784 ****
if ( pPack )
! dAmount = pPack->DeleteAmount( amount, 0xEED, 0 );
if ( ( dAmount > 0 ) && useBank )
--- 770,774 ----
if ( pPack )
! dAmount = pPack->deleteAmount( amount, 0xEED, 0 );
if ( ( dAmount > 0 ) && useBank )
***************
*** 787,791 ****
if ( pBank )
! dAmount += pBank->DeleteAmount( ( amount - dAmount ), 0xEED, 0 );
}
--- 777,781 ----
if ( pBank )
! dAmount += pBank->deleteAmount( ( amount - dAmount ), 0xEED, 0 );
}
Index: basechar.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.h,v
retrieving revision 1.77
retrieving revision 1.78
diff -C2 -d -r1.77 -r1.78
*** basechar.h 10 Aug 2004 03:15:56 -0000 1.77
--- basechar.h 12 Aug 2004 03:02:50 -0000 1.78
***************
*** 272,283 ****
virtual bool isInnocent();
void unhide();
! int CountItems( short ID, short col = -1 );
! int CountGold();
! P_ITEM GetItemOnLayer( unsigned char layer );
P_ITEM getBackpack();
P_ITEM getBankbox();
void setSerial( SERIAL ser );
! void MoveTo( short newx, short newy, signed char newz );
! bool Wears( P_ITEM pi );
unsigned int getSkillSum() const;
void Init( bool ser = true );
--- 272,282 ----
virtual bool isInnocent();
void unhide();
! int countItems( short ID, short col = -1 );
! int countGold();
! P_ITEM getItemOnLayer( unsigned char layer );
P_ITEM getBackpack();
P_ITEM getBankbox();
void setSerial( SERIAL ser );
! bool wears( P_ITEM pi );
unsigned int getSkillSum() const;
void Init( bool ser = true );
***************
*** 292,296 ****
virtual bool checkSkill( UI16 skill, SI32 min, SI32 max, bool advance = true );
cItem* atLayer( enLayer layer ) const;
! bool Owns( P_ITEM pi ) const;
virtual void callGuards();
virtual void flagUnchanged();
--- 291,295 ----
virtual bool checkSkill( UI16 skill, SI32 min, SI32 max, bool advance = true );
cItem* atLayer( enLayer layer ) const;
! bool owns( P_ITEM pi ) const;
virtual void callGuards();
virtual void flagUnchanged();
Index: npc.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v
retrieving revision 1.103
retrieving revision 1.104
diff -C2 -d -r1.103 -r1.104
*** npc.cpp 10 Aug 2004 03:15:57 -0000 1.103
--- npc.cpp 12 Aug 2004 03:02:50 -0000 1.104
***************
*** 618,622 ****
if ( pPack )
! dAmount = pPack->DeleteAmount( amount, 0xEED, 0 );
return dAmount;
--- 618,622 ----
if ( pPack )
! dAmount = pPack->deleteAmount( amount, 0xEED, 0 );
return dAmount;
***************
*** 685,689 ****
continue;
! P_ITEM contItem = this->GetItemOnLayer( contlayer );
if ( contItem != NULL )
contItem->processContainerNode( currNode );
--- 685,689 ----
continue;
! P_ITEM contItem = this->getItemOnLayer( contlayer );
if ( contItem != NULL )
contItem->processContainerNode( currNode );
***************
*** 1199,1203 ****
void cNPC::makeShop()
{
! P_ITEM currCont = GetItemOnLayer( BuyRestockContainer );
if ( !currCont )
{
--- 1199,1203 ----
void cNPC::makeShop()
{
! P_ITEM currCont = getItemOnLayer( BuyRestockContainer );
if ( !currCont )
{
***************
*** 1208,1212 ****
}
! currCont = GetItemOnLayer( BuyNoRestockContainer );
if ( !currCont )
{
--- 1208,1212 ----
}
! currCont = getItemOnLayer( BuyNoRestockContainer );
if ( !currCont )
{
***************
*** 1217,1221 ****
}
! currCont = GetItemOnLayer( SellContainer );
if ( !currCont )
{
--- 1217,1221 ----
}
! currCont = getItemOnLayer( SellContainer );
if ( !currCont )
{
***************
*** 1289,1294 ****
void cNPC::vendorBuy( P_PLAYER player )
{
! P_ITEM pContA = GetItemOnLayer( cBaseChar::BuyRestockContainer );
! P_ITEM pContB = GetItemOnLayer( cBaseChar::BuyNoRestockContainer );
if ( player->isDead() )
--- 1289,1294 ----
void cNPC::vendorBuy( P_PLAYER player )
{
! P_ITEM pContA = getItemOnLayer( cBaseChar::BuyRestockContainer );
! P_ITEM pContB = getItemOnLayer( cBaseChar::BuyNoRestockContainer );
if ( player->isDead() )
***************
*** 1307,1311 ****
void cNPC::vendorSell( P_PLAYER player )
{
! P_ITEM pContC = GetItemOnLayer( cBaseChar::SellContainer );
if ( !pContC || pContC->content().size() == 0 )
--- 1307,1311 ----
void cNPC::vendorSell( P_PLAYER player )
{
! P_ITEM pContC = getItemOnLayer( cBaseChar::SellContainer );
if ( !pContC || pContC->content().size() == 0 )
***************
*** 1415,1419 ****
// Now we call onCreate
! pChar->onCreate( section );
pChar->resend( false );
return pChar;
--- 1415,1420 ----
// Now we call onCreate
! cDelayedOnCreateCall* onCreateCall = new cDelayedOnCreateCall( pChar, section );
! Timers::instance()->insert( onCreateCall );
pChar->resend( false );
return pChar;
|