Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14349
Modified Files:
basechar.cpp basechar.h commands.cpp console.cpp console.h
coord.cpp coord.h customtags.cpp dbdriver.cpp definitions.cpp
dragdrop.cpp gumps.cpp gumps.h npc.cpp npc.h serverconfig.cpp
skills.cpp timers.cpp timing.cpp trade.cpp walking.cpp
Log Message:
I actually fixed most of the conversion warnings, and Wolfpack didn't break for me... so I'll commit. This removes quite a bit of warning garbage. :)
Index: trade.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/trade.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** trade.cpp 12 Aug 2004 03:02:51 -0000 1.7
--- trade.cpp 13 Aug 2004 08:55:26 -0000 1.8
***************
*** 315,319 ****
continue;
! if ( ( *it )->id() == pItem->id() && ( *it )->color() == pItem->color() &&
// (*it)->amount() >= pItem->amount() &&
( *it )->eventList() == pItem->eventList() )
--- 315,319 ----
continue;
! if ( ( *it )->id() == pItem->id() && ( *it )->color() == pItem->color() &&
// (*it)->amount() >= pItem->amount() &&
( *it )->eventList() == pItem->eventList() )
Index: gumps.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/gumps.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** gumps.h 5 Jul 2004 14:03:16 -0000 1.41
--- gumps.h 13 Aug 2004 08:55:25 -0000 1.42
***************
*** 252,278 ****
};
- class cWhoMenuGump : public cGump
- {
- private:
- UINT32 page_;
- std::vector<cUOSocket*> sockets_;
-
- public:
- cWhoMenuGump( UINT32 page );
-
- virtual void handleResponse( cUOSocket* socket, const gumpChoice_st& choice );
- };
-
- class cSocketInfoGump : public cGump
- {
- private:
- cUOSocket* socket_;
-
- public:
- cSocketInfoGump( cUOSocket* socket_ );
-
- virtual void handleResponse( cUOSocket* socket, const gumpChoice_st& choice );
- };
-
class cPagesGump : public cGump
{
--- 252,255 ----
Index: serverconfig.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/serverconfig.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** serverconfig.cpp 10 Aug 2004 03:15:57 -0000 1.3
--- serverconfig.cpp 13 Aug 2004 08:55:25 -0000 1.4
***************
*** 63,67 ****
// we do a dns lookup on this
! Q_INT32 uiValue = inet_addr( ( char* ) data.latin1() ) ;
if ( uiValue == INADDR_NONE )
{
--- 63,67 ----
// we do a dns lookup on this
! Q_UINT32 uiValue = inet_addr( ( char* ) data.latin1() ) ;
if ( uiValue == INADDR_NONE )
{
***************
*** 357,363 ****
static stGroupDoc group_doc[] =
{
! {"AI", "This group configures the NPC AI."},
! {"Accounts", "This group configures the account management."},
! {"Database", "This group configures access to the worldsave database."},
{0, 0}
};
--- 357,363 ----
static stGroupDoc group_doc[] =
{
! {"AI", "This group configures the NPC AI."},
! {"Accounts", "This group configures the account management."},
! {"Database", "This group configures access to the worldsave database."},
{0, 0}
};
***************
*** 391,395 ****
{"Accounts", "Auto Create", "If active login attempts with non-existing login names will create a new account automatically\n"
"This is very usefull for new shards without account policy\n"},
! {"Accounts", "Database Driver", "Possible values are: sqlite, mysql"},
{"Accounts", "Maximum Number of Characters", "Should not be more than 6, due to client restrictions"},
{"Accounts", "Use MD5 Hashed Passwords", "This will store hashed passwords, increasing password security."},
--- 391,395 ----
{"Accounts", "Auto Create", "If active login attempts with non-existing login names will create a new account automatically\n"
"This is very usefull for new shards without account policy\n"},
! {"Accounts", "Database Driver", "Possible values are: sqlite, mysql"},
{"Accounts", "Maximum Number of Characters", "Should not be more than 6, due to client restrictions"},
{"Accounts", "Use MD5 Hashed Passwords", "This will store hashed passwords, increasing password security."},
Index: basechar.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v
retrieving revision 1.128
retrieving revision 1.129
diff -C2 -d -r1.128 -r1.129
*** basechar.cpp 12 Aug 2004 19:01:14 -0000 1.128
--- basechar.cpp 13 Aug 2004 08:55:24 -0000 1.129
***************
*** 2204,2211 ****
}
! void cBaseChar::setStamina( INT16 data, bool notify /* = true */ )
{
stamina_ = data;
! changed_ = true;
}
--- 2204,2211 ----
}
! void cBaseChar::setStamina( INT16 data, bool notify )
{
stamina_ = data;
! changed_ = notify;
}
***************
*** 2798,2802 ****
// Fame is reduced by 10% upon death
! fame_ = (int)( (float)fame_ * 0.90 );
// Create the corpse
--- 2798,2802 ----
// Fame is reduced by 10% upon death
! fame_ = ( int ) ( ( float ) fame_ * 0.90 );
// Create the corpse
***************
*** 3331,3339 ****
if ( !isDead() )
{
! double chance = ( double ) stamina() / maxStamina();
double value = sqrt( skillValue( FOCUS ) * 0.0005 );
chance *= ( 1.0 - value );
chance += value;
! checkSkill( FOCUS, floor( ( 1.0 - chance ) * 1200 ), 1200 );
}
--- 3331,3339 ----
if ( !isDead() )
{
! double chance = ( double ) stamina() / ( double ) maxStamina();
double value = sqrt( skillValue( FOCUS ) * 0.0005 );
chance *= ( 1.0 - value );
chance += value;
! checkSkill( FOCUS, ( int ) floor( ( 1.0 - chance ) * 1200 ), 1200 );
}
***************
*** 3359,3363 ****
chance *= ( 1.0 - value );
chance += value;
! checkSkill( FOCUS, floor( ( 1.0 - chance ) * 1200 ), 1200 );
}
--- 3359,3363 ----
chance *= ( 1.0 - value );
chance += value;
! checkSkill( FOCUS, ( int ) floor( ( 1.0 - chance ) * 1200 ), 1200 );
}
Index: timers.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/timers.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** timers.cpp 12 Aug 2004 03:02:51 -0000 1.8
--- timers.cpp 13 Aug 2004 08:55:26 -0000 1.9
***************
*** 306,310 ****
cTimer* effect = *it;
! if ( ( !onlyDispellable || effect->dispellable ) && effect->getDest() == pc_dest->serial() && effect->objectID() == type )
{
pc_dest->removeTimer( effect );
--- 306,310 ----
cTimer* effect = *it;
! if ( ( !onlyDispellable || effect->dispellable ) && ( uint )effect->getDest() == ( uint )pc_dest->serial() && effect->objectID() == type )
{
pc_dest->removeTimer( effect );
***************
*** 348,352 ****
std::vector<cTimer*>::iterator i = teffects.begin();
for ( i = teffects.begin(); i != teffects.end(); i++ )
! if ( ( *i ) != NULL && ( *i )->dispellable && ( *i )->getDest() == pc_dest->serial() )
{
if ( isCharSerial( ( *i )->getDest() ) )
--- 348,352 ----
std::vector<cTimer*>::iterator i = teffects.begin();
for ( i = teffects.begin(); i != teffects.end(); i++ )
! if ( ( *i ) != NULL && ( *i )->dispellable && ( uint )( *i )->getDest() == ( uint )pc_dest->serial() )
{
if ( isCharSerial( ( *i )->getDest() ) )
***************
*** 465,469 ****
}
! cDelayedOnCreateCall::cDelayedOnCreateCall( cUObject* obj, const QString& definition ) :
obj_(obj), def_(definition)
{
--- 465,469 ----
}
! cDelayedOnCreateCall::cDelayedOnCreateCall( cUObject* obj, const QString& definition ) :
obj_(obj), def_(definition)
{
Index: definitions.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/definitions.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** definitions.cpp 10 Aug 2004 03:15:56 -0000 1.13
--- definitions.cpp 13 Aug 2004 08:55:25 -0000 1.14
***************
*** 679,683 ****
if ( min.contains( "." ) || max.contains( "." ) )
! Value += QString::number( RandomNum( min.toFloat(), max.toFloat() ) );
else
Value += QString::number( RandomNum( min.toInt(), max.toInt() ) );
--- 679,683 ----
if ( min.contains( "." ) || max.contains( "." ) )
! Value += QString::number( RandomNum( ( int ) min.toFloat(), ( int ) max.toFloat() ) );
else
Value += QString::number( RandomNum( min.toInt(), max.toInt() ) );
***************
*** 706,710 ****
if ( max.contains( "." ) || min.contains( "." ) )
! Value += QString::number( RandomNum( min.toFloat(), max.toFloat() ) );
else
Value += QString::number( RandomNum( min.toInt(), max.toInt() ) );
--- 706,710 ----
if ( max.contains( "." ) || min.contains( "." ) )
! Value += QString::number( RandomNum( ( int ) min.toFloat(), ( int ) max.toFloat() ) );
else
Value += QString::number( RandomNum( min.toInt(), max.toInt() ) );
Index: console.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** console.cpp 4 Aug 2004 23:17:35 -0000 1.22
--- console.cpp 13 Aug 2004 08:55:25 -0000 1.23
***************
*** 104,108 ****
}
! bool cConsole::handleCommand( const QString& command, bool silentFail )
{
cUOSocket* mSock;
--- 104,108 ----
}
! bool cConsole::handleCommand( const QString& command )
{
cUOSocket* mSock;
Index: coord.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/coord.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** coord.cpp 10 Aug 2004 03:15:56 -0000 1.50
--- coord.cpp 13 Aug 2004 08:55:25 -0000 1.51
***************
*** 141,147 ****
// Calculates the direction from one location to another
! unsigned char Coord_cl::direction( const Coord_cl& dest ) const
{
! unsigned char dir;
short xdif, ydif;
--- 141,147 ----
// Calculates the direction from one location to another
! unsigned int Coord_cl::direction( const Coord_cl& dest ) const
{
! unsigned int dir;
short xdif, ydif;
***************
*** 166,170 ****
dir = 7;
else
! dir = -1;
return dir;
--- 166,170 ----
dir = 7;
else
! dir = 8;
return dir;
***************
*** 877,882 ****
//Console::instance()->send( QString( "z1_up:%1,z2_up:%2,z1_down:%3,z2_down:%4\n" ).arg( z1_up ).arg( z2_up ).arg( z1_down ).arg( z2_down ) );
! zmax = QMAX( ceil( z1_up ), ceil( z2_up ) );
! zmin = QMIN( floor( z1_down ), floor( z2_down ) );
//Console::instance()->send( QString( "y:zmin:%1,zmax:%2\n" ).arg( zmin ).arg( zmax ) );
--- 877,882 ----
//Console::instance()->send( QString( "z1_up:%1,z2_up:%2,z1_down:%3,z2_down:%4\n" ).arg( z1_up ).arg( z2_up ).arg( z1_down ).arg( z2_down ) );
! zmax = ( signed char ) QMAX( ceil( z1_up ), ceil( z2_up ) );
! zmin = ( signed char ) QMIN( floor( z1_down ), floor( z2_down ) );
//Console::instance()->send( QString( "y:zmin:%1,zmax:%2\n" ).arg( zmin ).arg( zmax ) );
***************
*** 964,969 ****
//Console::instance()->send( QString( "z1_up:%1,z2_up:%2,z1_down:%3,z2_down:%4\n" ).arg( z1_up ).arg( z2_up ).arg( z1_down ).arg( z2_down ) );
! zmax = QMAX( ceil( z1_up ), ceil( z2_up ) );
! zmin = QMIN( floor( z1_down ), floor( z2_down ) );
if ( dz_up > 0 )
--- 964,969 ----
//Console::instance()->send( QString( "z1_up:%1,z2_up:%2,z1_down:%3,z2_down:%4\n" ).arg( z1_up ).arg( z2_up ).arg( z1_down ).arg( z2_down ) );
! zmax = ( signed char ) QMAX( ceil( z1_up ), ceil( z2_up ) );
! zmin = ( signed char ) QMIN( floor( z1_down ), floor( z2_down ) );
if ( dz_up > 0 )
***************
*** 1116,1126 ****
if ( z2_up == -300 )
{
! zmin = floor( z1_down );
! zmax = ceil( z1_up );
}
else
{
! zmin = QMIN( floor( z1_down ), floor( z2_down ) );
! zmax = QMAX( ceil( z1_up ), ceil( z2_up ) );
}
--- 1116,1126 ----
if ( z2_up == -300 )
{
! zmin = ( signed char ) floor( z1_down );
! zmax = ( signed char ) ceil( z1_up );
}
else
{
! zmin = ( signed char ) QMIN( floor( z1_down ), floor( z2_down ) );
! zmax = ( signed char ) QMAX( ceil( z1_up ), ceil( z2_up ) );
}
Index: gumps.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/gumps.cpp,v
retrieving revision 1.169
retrieving revision 1.170
diff -C2 -d -r1.169 -r1.170
*** gumps.cpp 10 Aug 2004 03:15:57 -0000 1.169
--- gumps.cpp 13 Aug 2004 08:55:25 -0000 1.170
***************
*** 192,440 ****
}
- cWhoMenuGump::cWhoMenuGump( UINT32 page )
- {
- if ( page == 0 )
- return;
-
- page_ = page;
- QStringList charNames;
- QStringList accNames;
- QStringList IPs;
- std::vector<UINT32> offsets;
- UINT32 offset = 0;
-
- sockets_.clear();
-
- for ( cUOSocket*mSock = Network::instance()->first(); mSock; mSock = Network::instance()->next() )
- {
- P_PLAYER pChar = mSock->player();
- if ( pChar )
- {
- charNames.push_back( pChar->name() );
- accNames.push_back( pChar->account()->login() );
- IPs.push_back( mSock->ip() );
- sockets_.push_back( mSock );
- offsets.push_back( offset );
- }
- offset++;
- }
-
- UINT32 numsocks = charNames.size();
- UINT32 pages = ( ( UINT32 ) ceil( ( double ) numsocks / 10.0f ) );
-
- startPage();
- addBackground( 0xE10, 380, 360 ); //Background
- addCheckertrans( 15, 15, 350, 330 );
- addGump( 130, 18, 0xFA8 );
- addText( 165, 20, tr( "Who Menu" ), 0x530 );
-
- // X button
- addText( 70, 320, "Close", 0x834 );
- addButton( 30, 320, 0xFB1, 0xFB3, 0 );
-
- startPage( 1 );
-
- INT32 i;
- INT32 right = page_ * 10 - 1;
- INT32 left = page_ * 10 - 10;
- if ( numsocks <= right )
- right = numsocks - 1;
-
- for ( i = left; i <= right; i++ )
- {
- addButton( 20, 60 + ( i - left ) * 22, 0xFA5, 0xFA7, offsets[i] + 3 );
- addText( 50, 60 + ( i - left ) * 22, QString( "%1(%2)" ).arg( charNames[i] ).arg( accNames[i] ), 0x834 );
- addText( 240, 60 + ( i - left ) * 22, QString( "%1" ).arg( IPs[i] ), 0x834 );
- }
-
- addText( 280, 320, tr( "Page %1 of %2" ).arg( page_ ).arg( pages ), 0x834 );
- if ( page_ > 1 ) // previous page
- addButton( 240, 320, 0x0FC, 0x0FC, 1 );
-
- if ( page_ < pages ) // next page
- addButton( 260, 320, 0x0FA, 0x0FA, 2 );
- }
-
- void cWhoMenuGump::handleResponse( cUOSocket* socket, const gumpChoice_st& choice )
- {
- if ( choice.button == 0 )
- return;
- else
- {
- switch ( choice.button )
- {
- case 1:
- {
- cWhoMenuGump* pGump = new cWhoMenuGump( page_ - 1 );
- socket->send( pGump );
- }
- break;
- case 2:
- {
- cWhoMenuGump* pGump = new cWhoMenuGump( page_ + 1 );
- socket->send( pGump );
- }
- break;
- default:
- {
- cSocketInfoGump* pGump = new cSocketInfoGump( sockets_[choice.button - 3] );
- socket->send( pGump );
- }
- break;
- }
- }
- }
-
- cSocketInfoGump::cSocketInfoGump( cUOSocket* socket )
- {
- if ( !socket )
- return;
-
- socket_ = socket;
- P_PLAYER pChar = socket->player();
-
- bool contains = false;
- for ( cUOSocket*mSock = Network::instance()->first(); mSock; mSock = Network::instance()->next() )
- {
- if ( mSock == socket )
- contains = true;
- }
-
- if ( contains && pChar )
- {
- startPage();
-
- addBackground( 0xE10, 440, 340 ); //Background
- addResizeGump( 195, 260, 0xBB8, 205, 20 );
- addCheckertrans( 15, 15, 410, 310 );
- addGump( 160, 18, 0xFA2 );
- addText( 195, 20, tr( "Socket Menu" ), 0x530 );
-
- // X button
- addText( 70, 300, "Close", 0x834 );
- addButton( 30, 300, 0xFB1, 0xFB3, 0 );
-
- startPage( 1 );
-
- addText( 50, 60, tr( "Char name:" ), 0x834 );
- addText( 250, 60, QString( "%1" ).arg( pChar->name() ), 0x834 );
- addText( 50, 80, tr( "IP:" ), 0x834 );
- addText( 250, 80, QString( "%1" ).arg( socket->ip() ), 0x834 );
- addText( 50, 100, tr( "Position:" ), 0x834 );
- addText( 250, 100, QString( "%1,%2,%3 map %4" ).arg( pChar->pos().x ).arg( pChar->pos().y ).arg( pChar->pos().z ).arg( pChar->pos().map ), 0x834 );
- addText( 50, 120, tr( "Region:" ), 0x834 );
- addText( 250, 120, QString( "%1" ).arg( pChar->region() ? pChar->region()->name() : QString( "" ) ), 0x834 );
- addText( 50, 140, tr( "Account / ACL:" ), 0x834 );
- addText( 250, 140, QString( "%1 / %2" ).arg( pChar->account()->login() ).arg( pChar->account()->acl() ), 0x834 );
-
- addButton( 20, 180, 0xFA5, 0xFA7, 1 );
- addText( 50, 180, tr( "Go to position" ), 0x834 );
- addButton( 20, 200, 0xFA5, 0xFA7, 2 );
- addText( 50, 200, tr( "Bring char" ), 0x834 );
- addButton( 20, 220, 0xFA5, 0xFA7, 3 );
- addText( 50, 220, tr( "Jail char" ), 0x834 );
- addButton( 20, 260, 0xFBD, 0xFBF, 6 );
- addText( 50, 260, tr( "Send message:" ), 0x834 );
- addInputField( 200, 260, 190, 16, 1, tr( "<msg>" ), 0x834 );
-
- addButton( 220, 180, 0xFAB, 0xFAD, 5 );
- addText( 250, 180, tr( "Show char info gump" ), 0x834 );
- addButton( 220, 200, 0xFA5, 0xFA7, 7 );
- addText( 250, 200, tr( "Disconnect" ), 0x834 );
- addButton( 220, 220, 0xFA5, 0xFA7, 4 );
- addText( 250, 220, tr( "Forgive char" ), 0x834 );
- }
- }
-
- void cSocketInfoGump::handleResponse( cUOSocket* socket, const gumpChoice_st& choice )
- {
- if ( !socket_ )
- return;
-
- bool contains = false;
- for ( cUOSocket*mSock = Network::instance()->first(); mSock && !contains; mSock = Network::instance()->next() )
- {
- if ( mSock == socket_ )
- contains = true;
- }
-
- if ( choice.button == 0 )
- return;
- else if ( contains && socket_->player() )
- {
- P_PLAYER pChar = socket_->player();
- P_PLAYER mChar = socket->player();
- switch ( choice.button )
- {
- case 1:
- // Check if the privileges are ok
- if ( mChar && !mChar->account()->authorized( "command", "go" ) )
- {
- socket->sysMessage( tr( "Access to command 'go' was denied" ) );
- }
- else if ( mChar )
- {
- mChar->removeFromView( false );
- mChar->moveTo( pChar->pos() );
- mChar->resend( false );
- }
- break;
- case 2:
- // Check if the privileges are ok
- if ( mChar && !mChar->account()->authorized( "command", "move" ) || pChar->account()->rank() >= mChar->account()->rank() )
- {
- socket->sysMessage( tr( "Access to command 'move' was denied" ) );
- }
- else if ( mChar )
- {
- pChar->removeFromView( false );
- pChar->moveTo( mChar->pos() );
- pChar->resend( false );
- }
- break;
- case 3:
- // TODO jail command
- break;
- case 4:
- // TODO forgive command
- break;
- case 5:
- // Check if the privileges are ok
- if ( mChar && !mChar->account()->authorized( "command", "info" ) )
- {
- socket->sysMessage( tr( "Access to command 'info' was denied" ) );
- }
- else
- {
- // cCharInfoGump* pGump = new cCharInfoGump( pChar );
- // socket->send( pGump );
- }
- break;
- case 6:
- {
- std::map<UINT16, QString>::const_iterator it = choice.textentries.find( 1 );
- if ( it != choice.textentries.end() )
- socket_->sysMessage( it->second );
-
- socket->sysMessage( tr( "Message sent." ) );
- }
- break;
- case 7:
- if ( pChar->account()->rank() >= mChar->account()->rank() )
- {
- socket->sysMessage( tr( "You're getting megalomaniac!" ) );
- }
- else
- {
- socket_->disconnect();
- socket->sysMessage( tr( "Socket disconnected." ) );
- }
- break;
- }
- }
- else
- socket->sysMessage( tr( "ERROR: Socket has disconnected or changed character in the meantime!" ) );
- }
-
cPagesGump::cPagesGump( UINT32 page, WPPAGE_TYPE ptype )
{
--- 192,195 ----
***************
*** 489,493 ****
INT32 right = page_ * 10 - 1;
INT32 left = page_ * 10 - 10;
! if ( numsocks <= right )
right = numsocks - 1;
--- 244,248 ----
INT32 right = page_ * 10 - 1;
INT32 left = page_ * 10 - 10;
! if ( ( signed int ) numsocks <= ( signed int ) right )
right = numsocks - 1;
***************
*** 685,700 ****
}
break;
- case 5:
- // Check if the privileges are ok
- if ( mChar && !mChar->account()->authorized( "command", "info" ) || pChar->account()->rank() >= mChar->account()->rank() )
- {
- socket->sysMessage( tr( "Access to command 'info' was denied" ) );
- }
- else
- {
- cSocketInfoGump* pGump = new cSocketInfoGump( pChar->socket() );
- socket->send( pGump );
- }
- break;
case 6:
cPagesManager::getInstance()->moveOnTop( page_ );
--- 440,443 ----
Index: timing.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/timing.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** timing.cpp 10 Aug 2004 03:15:57 -0000 1.11
--- timing.cpp 13 Aug 2004 08:55:26 -0000 1.12
***************
*** 62,67 ****
lastWorldsave_ = 0;
nextSpawnRegionCheck = time + Config::instance()->spawnRegionCheckTime() * MY_CLOCKS_PER_SEC;
! nextTamedCheck = time + Config::instance()->checkTamedTime() * MY_CLOCKS_PER_SEC;
! nextNpcCheck = time + Config::instance()->checkNPCTime() * MY_CLOCKS_PER_SEC;
nextItemCheck = time + 10000; // Every 10 seconds
nextShopRestock = time + 20 * 60 * MY_CLOCKS_PER_SEC; // Every 20 minutes
--- 62,67 ----
lastWorldsave_ = 0;
nextSpawnRegionCheck = time + Config::instance()->spawnRegionCheckTime() * MY_CLOCKS_PER_SEC;
! nextTamedCheck = ( uint )( time + Config::instance()->checkTamedTime() * MY_CLOCKS_PER_SEC );
! nextNpcCheck = ( uint )( time + Config::instance()->checkNPCTime() * MY_CLOCKS_PER_SEC );
nextItemCheck = time + 10000; // Every 10 seconds
nextShopRestock = time + 20 * 60 * MY_CLOCKS_PER_SEC; // Every 20 minutes
***************
*** 73,77 ****
inline int froundf( double f )
{
! int i = floor( f );
if ( f - i >= 0.50 )
{
--- 73,77 ----
inline int froundf( double f )
{
! int i = ( int )floor( f );
if ( f - i >= 0.50 )
{
***************
*** 276,283 ****
if ( nextTamedCheck <= time )
! nextTamedCheck = time + Config::instance()->checkTamedTime() * MY_CLOCKS_PER_SEC;
if ( nextNpcCheck <= time )
! nextNpcCheck = time + Config::instance()->checkNPCTime() * MY_CLOCKS_PER_SEC;
}
--- 276,283 ----
if ( nextTamedCheck <= time )
! nextTamedCheck = ( uint )( time + Config::instance()->checkTamedTime() * MY_CLOCKS_PER_SEC );
if ( nextNpcCheck <= time )
! nextNpcCheck = ( uint )( time + Config::instance()->checkNPCTime() * MY_CLOCKS_PER_SEC );
}
***************
*** 306,310 ****
character->setHitpoints( character->hitpoints() + 1 );
character->updateHealth();
! character->setRegenHitpointsTime( Server::instance()->time() + floor( character->getHitpointRate() * 1000 ) );
}
}
--- 306,310 ----
character->setHitpoints( character->hitpoints() + 1 );
character->updateHealth();
! character->setRegenHitpointsTime( ( uint )( Server::instance()->time() + floor( character->getHitpointRate() * 1000 ) ) );
}
}
***************
*** 316,320 ****
{
character->setStamina( character->stamina() + 1 );
! character->setRegenStaminaTime( Server::instance()->time() + floor( character->getStaminaRate() * 1000 ) );
P_PLAYER player = dynamic_cast<P_PLAYER>( character );
--- 316,320 ----
{
character->setStamina( character->stamina() + 1 );
! character->setRegenStaminaTime( ( uint )( Server::instance()->time() + floor( character->getStaminaRate() * 1000 ) ) );
P_PLAYER player = dynamic_cast<P_PLAYER>( character );
***************
*** 331,335 ****
{
character->setMana( character->mana() + 1 );
! character->setRegenManaTime( Server::instance()->time() + floor( character->getManaRate() * 1000 ) );
P_PLAYER player = dynamic_cast<P_PLAYER>( character );
--- 331,335 ----
{
character->setMana( character->mana() + 1 );
! character->setRegenManaTime( ( uint )( Server::instance()->time() + floor( character->getManaRate() * 1000 ) ) );
P_PLAYER player = dynamic_cast<P_PLAYER>( character );
***************
*** 418,422 ****
if ( npc->ai() && npc->aiCheckTime() <= time )
{
! npc->setAICheckTime( time + Config::instance()->checkAITime() * MY_CLOCKS_PER_SEC );
npc->ai()->check();
}
--- 418,422 ----
if ( npc->ai() && npc->aiCheckTime() <= time )
{
! npc->setAICheckTime( ( uint )( time + Config::instance()->checkAITime() * MY_CLOCKS_PER_SEC ) );
npc->ai()->check();
}
Index: coord.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/coord.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** coord.h 2 Jun 2004 15:04:04 -0000 1.20
--- coord.h 13 Aug 2004 08:55:25 -0000 1.21
***************
*** 54,58 ****
Coord_cl operator-( const Coord_cl& src ) const;
unsigned int distance( const Coord_cl& src ) const;
! unsigned char direction( const Coord_cl& dest ) const;
bool lineOfSight( const Coord_cl& target, bool touch = false );
bool lineOfSight( const Coord_cl& target, UI16 targethight, bool touch = false );
--- 54,58 ----
Coord_cl operator-( const Coord_cl& src ) const;
unsigned int distance( const Coord_cl& src ) const;
! unsigned int direction( const Coord_cl& dest ) const;
bool lineOfSight( const Coord_cl& target, bool touch = false );
bool lineOfSight( const Coord_cl& target, UI16 targethight, bool touch = false );
Index: basechar.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.h,v
retrieving revision 1.78
retrieving revision 1.79
diff -C2 -d -r1.78 -r1.79
*** basechar.h 12 Aug 2004 03:02:50 -0000 1.78
--- basechar.h 13 Aug 2004 08:55:24 -0000 1.79
***************
*** 241,245 ****
virtual void soundEffect( UI16 soundId, bool hearAll = true ) = 0;
virtual void giveGold( Q_UINT32 amount, bool inBank = false ) = 0;
! virtual uint takeGold( uint amount, bool useBank = false ) = 0;
virtual void log( eLogLevel, const QString& string ) = 0;
virtual void log( const QString& string ) = 0;
--- 241,245 ----
virtual void soundEffect( UI16 soundId, bool hearAll = true ) = 0;
virtual void giveGold( Q_UINT32 amount, bool inBank = false ) = 0;
! virtual uint takeGold( uint amount, bool inBank = false ) = 0;
virtual void log( eLogLevel, const QString& string ) = 0;
virtual void log( const QString& string ) = 0;
Index: dragdrop.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dragdrop.cpp,v
retrieving revision 1.240
retrieving revision 1.241
diff -C2 -d -r1.240 -r1.241
*** dragdrop.cpp 12 Aug 2004 03:02:50 -0000 1.240
--- dragdrop.cpp 13 Aug 2004 08:55:25 -0000 1.241
***************
*** 445,449 ****
// Get the data
! SERIAL contId = packet->cont();
Coord_cl dropPos = pChar->pos(); // plane
--- 445,449 ----
// Get the data
! //SERIAL contId = packet->cont();
Coord_cl dropPos = pChar->pos(); // plane
Index: commands.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/commands.cpp,v
retrieving revision 1.253
retrieving revision 1.254
diff -C2 -d -r1.253 -r1.254
*** commands.cpp 10 Aug 2004 03:15:56 -0000 1.253
--- commands.cpp 13 Aug 2004 08:55:24 -0000 1.254
***************
*** 790,794 ****
if ( x == 1383 && y >= 1642 && y <= 1643 )
return 0;
! if ( !Maps::instance()->canFit( x, y, z, map, 16 ) )
return 0;
cItem* door = cItem::createFromScript( QString::number( 0x6A5 + 2 * int( facing ), 16 ) );
--- 790,794 ----
if ( x == 1383 && y >= 1642 && y <= 1643 )
return 0;
! if ( !Maps::instance()->canFit( x, y, z, map ) )
return 0;
cItem* door = cItem::createFromScript( QString::number( 0x6A5 + 2 * int( facing ), 16 ) );
***************
*** 887,890 ****
--- 887,891 ----
{ 250, 750, 775, 1330 }, { 525, 2095, 925, 2430 }, { 1025, 2155, 1265, 2310 }, { 1635, 2430, 1705, 2508 }, { 1775, 2605, 2165, 2975 }, { 1055, 3520, 1570, 4075 }, { 2860, 3310, 3120, 3630 }, { 2470, 1855, 3950, 3045 }, { 3425, 990, 3900, 1455 }, { 4175, 735, 4840, 1600 }, { 2375, 330, 3100, 1045 }, { 2100, 1090, 2310, 1450 }, { 1495, 1400, 1550, 1475 }, { 1085, 1520, 1415, 1910 }, { 1410, 1500, 1745, 1795 }, { 5120, 2300, 6143, 4095 }
};
+ /*
int IlshRegions[][4] =
{
***************
*** 895,898 ****
--- 896,900 ----
{ 0, 0, 320 * 8, 256 * 8 }
};
+ */
socket->sysMessage( "Generating doors, please wait ( Slow )" );
Index: walking.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/walking.cpp,v
retrieving revision 1.132
retrieving revision 1.133
diff -C2 -d -r1.132 -r1.133
*** walking.cpp 10 Aug 2004 03:15:57 -0000 1.132
--- walking.cpp 13 Aug 2004 08:55:26 -0000 1.133
***************
*** 616,620 ****
{
// Don't regenerate stamina while running
! pChar->setRegenStaminaTime( Server::instance()->time() + floor( pChar->getStaminaRate() * 1000 ) );
pChar->setRunningSteps( pChar->runningSteps() + 1 );
--- 616,620 ----
{
// Don't regenerate stamina while running
! pChar->setRegenStaminaTime( ( uint )( Server::instance()->time() + floor( pChar->getStaminaRate() * 1000 ) ) );
pChar->setRunningSteps( pChar->runningSteps() + 1 );
Index: skills.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/skills.cpp,v
retrieving revision 1.229
retrieving revision 1.230
diff -C2 -d -r1.229 -r1.230
*** skills.cpp 5 Aug 2004 01:48:38 -0000 1.229
--- skills.cpp 13 Aug 2004 08:55:25 -0000 1.230
***************
*** 184,188 ****
// We have the chance of 1/chance that we reached our desired item
! if ( RandomNum( 1, chance ) == chance )
{
pToSteal = pItem;
--- 184,188 ----
// We have the chance of 1/chance that we reached our desired item
! if ( RandomNum( 1, ( int )chance ) == ( int )chance )
{
pToSteal = pItem;
***************
*** 197,201 ****
// The success of our Theft depends on the weight of the stolen item
! bool success = pChar->checkSkill( STEALING, 0, pToSteal->weight() );
bool caught = false;
--- 197,201 ----
// The success of our Theft depends on the weight of the stolen item
! bool success = pChar->checkSkill( STEALING, 0, ( long int )pToSteal->weight() );
bool caught = false;
***************
*** 228,232 ****
{
P_NPC pn = dynamic_cast<P_NPC>( pVictim );
! pVictim->talk( tr( "Guards! A thief is amoung us!" ), -1, 0x09 );
if ( pVictim->region() && pVictim->region()->isGuarded() )
pn->callGuards();
--- 228,232 ----
{
P_NPC pn = dynamic_cast<P_NPC>( pVictim );
! pVictim->talk( tr( "Guards! A thief is amoung us!" ), 0xFFFF, 0x09 );
if ( pVictim->region() && pVictim->region()->isGuarded() )
pn->callGuards();
Index: console.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/console.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** console.h 2 Jun 2004 15:04:04 -0000 1.16
--- console.h 13 Aug 2004 08:55:25 -0000 1.17
***************
*** 81,85 ****
\params silent Should the command fail silently.
*/
! bool handleCommand( const QString& command, bool silent = false );
public:
--- 81,85 ----
\params silent Should the command fail silently.
*/
! bool handleCommand( const QString& command );
public:
Index: customtags.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/customtags.cpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -d -r1.52 -r1.53
*** customtags.cpp 10 Aug 2004 03:15:56 -0000 1.52
--- customtags.cpp 13 Aug 2004 08:55:25 -0000 1.53
***************
*** 390,394 ****
if ( typ == Long )
! return value.d;
if ( typ == Double )
--- 390,394 ----
if ( typ == Long )
! return ( int ) value.d;
if ( typ == Double )
***************
*** 469,476 ****
if ( typ == Long )
! return FindCharBySerial( value.d );
if ( typ == Double )
! return FindCharBySerial( floor( value.d ) );
return 0;
--- 469,476 ----
if ( typ == Long )
! return FindCharBySerial( ( unsigned int ) value.d );
if ( typ == Double )
! return FindCharBySerial( ( unsigned int ) floor( value.d ) );
return 0;
***************
*** 493,500 ****
if ( typ == Long )
! return FindItemBySerial( value.d );
if ( typ == Double )
! return FindItemBySerial( floor( value.d ) );
return 0;
--- 493,500 ----
if ( typ == Long )
! return FindItemBySerial( ( unsigned int ) value.d );
if ( typ == Double )
! return FindItemBySerial( ( unsigned int ) floor( value.d ) );
return 0;
***************
*** 752,756 ****
( ( Coord_cl * ) ( value.ptr ) )->y = reader.readShort();
( ( Coord_cl * ) ( value.ptr ) )->z = reader.readByte();
! ( ( Coord_cl * ) ( value.ptr ) )->map = reader.readByte();
reader.readShort();
break;
--- 752,756 ----
( ( Coord_cl * ) ( value.ptr ) )->y = reader.readShort();
( ( Coord_cl * ) ( value.ptr ) )->z = reader.readByte();
! ( ( Coord_cl * ) ( value.ptr ) )->map = reader.readByte();
reader.readShort();
break;
Index: npc.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.h,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -d -r1.54 -r1.55
*** npc.h 10 Aug 2004 03:15:57 -0000 1.54
--- npc.h 13 Aug 2004 08:55:25 -0000 1.55
***************
*** 106,110 ****
virtual bool inWorld();
virtual void giveGold( Q_UINT32 amount, bool inBank = false );
! virtual UINT32 takeGold( UINT32 amount, bool useBank = false );
virtual void applyDefinition( const cElement* );
virtual void flagUnchanged()
--- 106,110 ----
virtual bool inWorld();
virtual void giveGold( Q_UINT32 amount, bool inBank = false );
! virtual UINT32 takeGold( UINT32 amount, bool inBank = false );
virtual void applyDefinition( const cElement* );
virtual void flagUnchanged()
Index: dbdriver.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dbdriver.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** dbdriver.cpp 10 Aug 2004 03:15:56 -0000 1.39
--- dbdriver.cpp 13 Aug 2004 08:55:25 -0000 1.40
***************
*** 190,199 ****
{
PyObject_HEAD_INIT( NULL )
! 0,
! "dbresult",
! sizeof( wpDbResultType ),
! 0,
! wpDeallocDbResult,
! 0,
( getattrfunc ) wpDbResult_getAttr,
0,
--- 190,199 ----
{
PyObject_HEAD_INIT( NULL )
! 0,
! "dbresult",
! sizeof( wpDbResultType ),
! 0,
! wpDeallocDbResult,
! 0,
( getattrfunc ) wpDbResult_getAttr,
0,
Index: npc.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v
retrieving revision 1.104
retrieving revision 1.105
diff -C2 -d -r1.104 -r1.105
*** npc.cpp 12 Aug 2004 03:02:50 -0000 1.104
--- npc.cpp 13 Aug 2004 08:55:25 -0000 1.105
***************
*** 267,275 ****
if ( isTamed() )
{
! interval = Config::instance()->tamedNpcMoveTime() * MY_CLOCKS_PER_SEC;
}
else
{
! interval = Config::instance()->npcMoveTime() * MY_CLOCKS_PER_SEC;
}
--- 267,275 ----
if ( isTamed() )
{
! interval = ( unsigned int ) Config::instance()->tamedNpcMoveTime() * MY_CLOCKS_PER_SEC;
}
else
{
! interval = ( unsigned int ) Config::instance()->npcMoveTime() * MY_CLOCKS_PER_SEC;
}
***************
*** 611,616 ****
}
! UINT32 cNPC::takeGold( UINT32 amount, bool useBank )
{
P_ITEM pPack = getBackpack();
--- 611,617 ----
}
! UINT32 cNPC::takeGold( UINT32 amount, bool inBank )
{
+ Q_UNUSED( inBank );
P_ITEM pPack = getBackpack();
***************
*** 1431,1435 ****
P_ITEM mount = player->atLayer( cBaseChar::Mount );
! if ( mount && mount->getTag( "pet" ).toInt() == serial_ )
{
mount->remove();
--- 1432,1436 ----
P_ITEM mount = player->atLayer( cBaseChar::Mount );
! if ( mount && ( unsigned int ) mount->getTag( "pet" ).toInt() == serial_ )
{
mount->remove();
|