Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22074
Modified Files:
ChangeLog basechar.cpp items.cpp items.h log.h player.cpp
speech.cpp trade.cpp
Log Message:
bugfixing session
Index: items.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.h,v
retrieving revision 1.218
retrieving revision 1.219
diff -C2 -d -r1.218 -r1.219
*** items.h 24 Sep 2004 04:47:25 -0000 1.218
--- items.h 8 Oct 2004 01:13:15 -0000 1.219
***************
*** 362,366 ****
void moveTo( const Coord_cl& pos, bool noremove = false );
! long reduceAmount( short amount = 1 );
short containerGumpType() const;
void setRandPosInCont( cItem* pCont );
--- 362,366 ----
void moveTo( const Coord_cl& pos, bool noremove = false );
! long reduceAmount( unsigned int amount = 1 );
short containerGumpType() const;
void setRandPosInCont( cItem* pCont );
Index: trade.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/trade.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** trade.cpp 22 Sep 2004 05:34:47 -0000 1.13
--- trade.cpp 8 Oct 2004 01:13:16 -0000 1.14
***************
*** 179,183 ****
Q_UINT32 bankGold = pChar->countBankGold();
Q_UINT32 packGold = pChar->countGold();
! bool fromBank;
if ( !pChar->isGM() )
--- 179,183 ----
Q_UINT32 bankGold = pChar->countBankGold();
Q_UINT32 packGold = pChar->countGold();
! bool fromBank = false;
if ( !pChar->isGM() )
***************
*** 335,339 ****
// now look for the item in the player's pack
! if (pItem->container() != pPack) {
socket->sysMessage( tr( "Invalid item sold." ) );
socket->send( &clearBuy );
--- 335,339 ----
// now look for the item in the player's pack
! if (pItem->getOutmostChar() != pChar) {
socket->sysMessage( tr( "Invalid item sold." ) );
socket->send( &clearBuy );
Index: basechar.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v
retrieving revision 1.158
retrieving revision 1.159
diff -C2 -d -r1.158 -r1.159
*** basechar.cpp 7 Oct 2004 23:02:26 -0000 1.158
--- basechar.cpp 8 Oct 2004 01:13:15 -0000 1.159
***************
*** 2840,2844 ****
}
}
! }
// Fame is reduced by 10% upon death
--- 2840,2844 ----
}
}
! }
// Fame is reduced by 10% upon death
***************
*** 2853,2856 ****
--- 2853,2890 ----
bool summoned = npc && npc->summoned();
+ // Kill Logging
+ QString logName;
+ if (npc) {
+ if (summoned) {
+ logName = tr("Summoned npc '%1' ('%2', 0x%3)").arg(name()).arg(baseid()).arg(serial_, 0, 16);
+ } else {
+ logName = tr("Npc '%1' ('%2', 0x%3)").arg(name()).arg(baseid()).arg(serial_, 0, 16);
+ }
+ } else if (player) {
+ logName = tr("Player '%1' ('%2', 0x%3)").arg(name()).arg(player->account() ? player->account()->login() : QString("Unknown")).arg(serial_, 0, 16);
+ }
+
+ QString killerName;
+ if (pKiller && pKiller != this) {
+ P_NPC pKillerNpc = dynamic_cast<P_NPC>(pKiller);
+ P_PLAYER pKillerPlayer = dynamic_cast<P_PLAYER>(pKiller);
+
+ if (pKillerNpc) {
+ if (pKillerNpc->summoned()) {
+ killerName = tr("summoned npc '%1' ('%2', 0x%3)").arg(pKiller->name()).arg(pKiller->baseid()).arg(pKiller->serial(), 0, 16);
+ } else {
+ killerName = tr("npc '%1' ('%2', 0x%3)").arg(pKiller->name()).arg(pKiller->baseid()).arg(pKiller->serial(), 0, 16);
+ }
+ } else if (pKillerPlayer) {
+ killerName = tr("player '%1' ('%2', 0x%3)").arg(pKiller->name()).arg(pKillerPlayer->account() ? pKillerPlayer->account()->login() : QString("Unknown")).arg(pKillerPlayer->serial(), 0, 16);
+ }
+ } else if (pKiller && pKiller == this) {
+ killerName = tr("himself");
+ } else if (!pKiller) {
+ killerName = tr("accident");
+ }
+
+ log(LOG_TRACE, tr("%1 was killed by %2.\n").arg(logName).arg(killerName));
+
if ( player )
player->unmount();
Index: log.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/log.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** log.h 10 Aug 2004 03:15:57 -0000 1.11
--- log.h 8 Oct 2004 01:13:15 -0000 1.12
***************
*** 48,51 ****
--- 48,52 ----
LOG_TRACE = 0x20,
LOG_DEBUG = 0x40,
+ LOG_SPEECH = 0x80,
LOG_ALL = 0xFF
};
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.135
retrieving revision 1.136
diff -C2 -d -r1.135 -r1.136
*** player.cpp 4 Oct 2004 21:50:16 -0000 1.135
--- player.cpp 8 Oct 2004 01:13:15 -0000 1.136
***************
*** 752,757 ****
P_ITEM pile = cItem::createFromScript( "eed" );
pile->setAmount( QMIN( total, static_cast<Q_UINT32>( 65535 ) ) );
- pCont->addItem( pile );
total -= pile->amount();
}
--- 752,761 ----
P_ITEM pile = cItem::createFromScript( "eed" );
pile->setAmount( QMIN( total, static_cast<Q_UINT32>( 65535 ) ) );
total -= pile->amount();
+
+ pCont->addItem( pile );
+ if (!pile->free) {
+ pile->update();
+ }
}
Index: speech.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/speech.cpp,v
retrieving revision 1.189
retrieving revision 1.190
diff -C2 -d -r1.189 -r1.190
*** speech.cpp 25 Sep 2004 19:57:12 -0000 1.189
--- speech.cpp 8 Oct 2004 01:13:16 -0000 1.190
***************
*** 272,275 ****
--- 272,278 ----
return;
+ // log
+ pChar->log(LOG_SPEECH, tr("Saying '%1' (%2, 0x%3).\n").arg(speech).arg(font).arg(color, 0, 16));
+
pChar->unhide();
Index: ChangeLog
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/ChangeLog,v
retrieving revision 1.98
retrieving revision 1.99
diff -C2 -d -r1.98 -r1.99
*** ChangeLog 6 Oct 2004 22:16:58 -0000 1.98
--- ChangeLog 8 Oct 2004 01:13:15 -0000 1.99
***************
*** 32,35 ****
--- 32,38 ----
- SIGPIPE is now ignored on unix systems.
- Bugfix for the unix console.
+ - Added several logging features.
+ - Added the ability to sell items from subpacks.
+ - Fixed a bug (Exploit) related to consumeResource.
Wolfpack 12.9.11 Beta (26. September 2004)
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.451
retrieving revision 1.452
diff -C2 -d -r1.451 -r1.452
*** items.cpp 22 Sep 2004 05:34:46 -0000 1.451
--- items.cpp 8 Oct 2004 01:13:15 -0000 1.452
***************
*** 149,155 ****
* the remainder is returned
*/
! long cItem::reduceAmount( const short amt )
{
! Q_UINT16 rest = 0;
if ( amount_ > amt )
{
--- 149,155 ----
* the remainder is returned
*/
! long cItem::reduceAmount( unsigned int amt )
{
! Q_UINT32 rest = 0;
if ( amount_ > amt )
{
***************
*** 161,166 ****
else
{
- this->remove();
rest = amt - amount_;
}
return rest;
--- 161,166 ----
else
{
rest = amt - amount_;
+ this->remove();
}
return rest;
***************
*** 328,332 ****
int cItem::deleteAmount( int amount, unsigned short _id, unsigned short _color )
{
! int rest = amount;
P_ITEM pi;
cItem::ContainerContent container( this->content() );
--- 328,332 ----
int cItem::deleteAmount( int amount, unsigned short _id, unsigned short _color )
{
! unsigned int rest = amount;
P_ITEM pi;
cItem::ContainerContent container( this->content() );
|