Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11602
Modified Files:
accounts.cpp basechar.cpp boats.cpp corpse.cpp house.cpp
items.cpp multis.cpp npc.cpp player.cpp resources.cpp
uobject.cpp world.cpp
Log Message:
This doesn't appear to break anything... I've noticed that a lot of SQL
queries don't have the ` for `field` `table` stuff, using them helps prevent
errors and can also increase responce times with MySQL. By doing this, I
seem to be getting slightly lower save times than before, about 5-40ms.
Assuming this really doesn't break anything, might be good to do this with
other mysql queries...
Index: accounts.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/accounts.cpp,v
retrieving revision 1.78
retrieving revision 1.79
diff -C2 -d -r1.78 -r1.79
*** accounts.cpp 30 Jan 2004 18:07:38 -0000 1.78
--- accounts.cpp 30 Jan 2004 20:29:25 -0000 1.79
***************
*** 43,55 ****
// DB AutoCreation
! const char *createSql = "CREATE TABLE accounts (\
! login varchar(255) NOT NULL default '',\
! password varchar(255) NOT NULL default '',\
! flags int NOT NULL default '0',\
! acl varchar(255) NOT NULL default 'player',\
! lastlogin int NOT NULL default '',\
! blockuntil int NOT NULL default '',\
! PRIMARY KEY (login)\
! );";
/*****************************************************************************
--- 43,55 ----
// DB AutoCreation
! const char *createSql = "CREATE TABLE `accounts` (\
! `login` varchar(255) NOT NULL default '',\
! `password` varchar(255) NOT NULL default '',\
! `flags` int NOT NULL default '0',\
! `acl` varchar(255) NOT NULL default 'player',\
! `lastlogin` int NOT NULL default '',\
! `blockuntil` int NOT NULL default '',\
! PRIMARY KEY (`login`)\
! );";
/*****************************************************************************
***************
*** 237,241 ****
iterator it = accounts.begin();
for (; it != accounts.end(); ++it)
! delete it.data();
}
--- 237,241 ----
iterator it = accounts.begin();
for (; it != accounts.end(); ++it)
! delete it.data();
}
***************
*** 249,253 ****
// First we check for blocked account.
if ( it.data()->isBlocked() )
! {
if( error )
*error = Banned;
--- 249,253 ----
// First we check for blocked account.
if ( it.data()->isBlocked() )
! {
if( error )
*error = Banned;
***************
*** 262,266 ****
}
! // Ok, let´s continue.
if (it.data()->password() == password)
{
--- 262,266 ----
}
! // Ok, lets continue.
if (it.data()->password() == password)
{
***************
*** 312,324 ****
persistentBroker->executeQuery( "BEGIN;" );
! persistentBroker->executeQuery( "DELETE FROM accounts;" );
iterator it = accounts.begin();
for (; it != accounts.end(); ++it)
{
! // INSERT
cAccount *account = it.data();
!
! QString sql( "INSERT INTO accounts VALUES( '%1', '%2', %3, '%4', %5, %6 );" );
sql = sql.arg( account->login_.lower() ).arg( account->password_ ).arg( account->flags_ ).arg( account->aclName_ ).arg( !account->lastLogin_.isNull() ? account->lastLogin_.toTime_t() : 0 ).arg( !account->blockUntil.isNull() ? account->blockUntil.toTime_t() : 0 );
--- 312,324 ----
persistentBroker->executeQuery( "BEGIN;" );
! persistentBroker->executeQuery( "DELETE FROM `accounts`;" );
iterator it = accounts.begin();
for (; it != accounts.end(); ++it)
{
! // INSERT
cAccount *account = it.data();
!
! QString sql( "INSERT INTO `accounts` VALUES( '%1', '%2', %3, '%4', %5, %6 );" );
sql = sql.arg( account->login_.lower() ).arg( account->password_ ).arg( account->flags_ ).arg( account->aclName_ ).arg( !account->lastLogin_.isNull() ? account->lastLogin_.toTime_t() : 0 ).arg( !account->blockUntil.isNull() ? account->blockUntil.toTime_t() : 0 );
***************
*** 340,344 ****
persistentBroker->executeQuery( "ROLLBACK;" );
Console::instance()->log( LOG_ERROR, "Unknown error while saving Accounts." );
! }
}
--- 340,344 ----
persistentBroker->executeQuery( "ROLLBACK;" );
Console::instance()->log( LOG_ERROR, "Unknown error while saving Accounts." );
! }
}
***************
*** 366,370 ****
}
! cDBResult result = persistentBroker->query( "SELECT accounts.login,accounts.password,accounts.flags,accounts.acl,accounts.lastlogin,accounts.blockuntil FROM accounts;" );
// Clear Accounts HERE
--- 366,370 ----
}
! cDBResult result = persistentBroker->query( "SELECT `login`,`password`,`flags`,`acl`,`lastlogin`,`blockuntil` FROM `accounts`;" );
// Clear Accounts HERE
***************
*** 396,400 ****
{
Console::instance()->log( LOG_ERROR, "Unknown error while loading Accounts" );
! }
}
--- 396,400 ----
{
Console::instance()->log( LOG_ERROR, "Unknown error while loading Accounts" );
! }
}
***************
*** 449,453 ****
/*!
Creates an account with \a login and \a password. If this is the first account
! on the system, it will be set with "admin" acl, otherwise, it will default to
"player" acl.
*/
--- 449,453 ----
/*!
Creates an account with \a login and \a password. If this is the first account
! on the system, it will be set with "admin" acl, otherwise, it will default to
"player" acl.
*/
Index: basechar.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -d -r1.53 -r1.54
*** basechar.cpp 30 Jan 2004 15:28:49 -0000 1.53
--- basechar.cpp 30 Jan 2004 20:29:25 -0000 1.54
***************
*** 202,211 ****
attackerSerial_ = atoi( result[offset++] );
combatTarget_ = atoi( result[offset++] );
! murdererSerial_ = atoi( result[offset++] );
ser = atoi( result[offset++] );
guarding_ = dynamic_cast<P_PLAYER>(FindCharBySerial( ser ));
!
// Query the Skills for this character
! QString sql = "SELECT skills.skill,skills.value,skills.locktype,skills.cap FROM skills WHERE serial = '" + QString::number( serial() ) + "'";
cDBResult res = persistentBroker->query( sql );
--- 202,211 ----
attackerSerial_ = atoi( result[offset++] );
combatTarget_ = atoi( result[offset++] );
! murdererSerial_ = atoi( result[offset++] );
ser = atoi( result[offset++] );
guarding_ = dynamic_cast<P_PLAYER>(FindCharBySerial( ser ));
!
// Query the Skills for this character
! QString sql = "SELECT `skill`,`value`,`locktype`,`cap` FROM `skills` WHERE `serial` = '" + QString::number( serial() ) + "'";
cDBResult res = persistentBroker->query( sql );
***************
*** 248,254 ****
initSave;
setTable( "characters" );
!
addField( "serial", serial() );
! addStrField( "name", orgName_ );
addStrField( "title", title_ );
addStrField( "creationdate", creationDate_.toString() );
--- 248,254 ----
initSave;
setTable( "characters" );
!
addField( "serial", serial() );
! addStrField( "name", orgName_ );
addStrField( "title", title_ );
addStrField( "creationdate", creationDate_.toString() );
***************
*** 290,294 ****
addCondition( "serial", serial() );
saveFields;
!
QValueVector< stSkillValue >::const_iterator it;
int i = 0;
--- 290,294 ----
addCondition( "serial", serial() );
saveFields;
!
QValueVector< stSkillValue >::const_iterator it;
int i = 0;
***************
*** 314,323 ****
bool cBaseChar::del()
! {
if( !isPersistent )
return false; // We didn't need to delete the object
! persistentBroker->addToDeleteQueue( "characters", QString( "serial = '%1'" ).arg( serial() ) );
! persistentBroker->addToDeleteQueue( "skills", QString( "serial = '%1'" ).arg( serial() ) );
changed_ = true;
return cUObject::del();
--- 314,323 ----
bool cBaseChar::del()
! {
if( !isPersistent )
return false; // We didn't need to delete the object
! persistentBroker->addToDeleteQueue( "characters", QString( "`serial` = '%1'" ).arg( serial() ) );
! persistentBroker->addToDeleteQueue( "skills", QString( "`serial` = '%1'" ).arg( serial() ) );
changed_ = true;
return cUObject::del();
***************
*** 328,332 ****
World::instance()->registerObject( pc );
pc->setRegion( AllTerritories::instance()->region( pc->pos().x, pc->pos().y, pc->pos().map ) );
!
if (pc->bodyID() <= 0x3e1)
{
--- 328,332 ----
World::instance()->registerObject( pc );
pc->setRegion( AllTerritories::instance()->region( pc->pos().x, pc->pos().y, pc->pos().map ) );
!
if (pc->bodyID() <= 0x3e1)
{
***************
*** 343,348 ****
}
}
! }
!
UINT16 max_x = Map->mapTileWidth(pc->pos().map) * 8;
UINT16 max_y = Map->mapTileHeight(pc->pos().map) * 8;
--- 343,348 ----
}
}
! }
!
UINT16 max_x = Map->mapTileWidth(pc->pos().map) * 8;
UINT16 max_y = Map->mapTileHeight(pc->pos().map) * 8;
***************
*** 353,357 ****
cCharStuff::DeleteChar( pc );
return;
! }
}
--- 353,357 ----
cCharStuff::DeleteChar( pc );
return;
! }
}
***************
*** 377,381 ****
if( !pPlayer || !pPlayer->socket() || !pPlayer->inRange( this, pPlayer->visualRange() ) || ( isHidden() && !pPlayer->isGM() && this != pPlayer ) )
continue;
!
pPlayer->socket()->updateHealth( this );
}
--- 377,381 ----
if( !pPlayer || !pPlayer->socket() || !pPlayer->inRange( this, pPlayer->visualRange() ) || ( isHidden() && !pPlayer->isGM() && this != pPlayer ) )
continue;
!
pPlayer->socket()->updateHealth( this );
}
***************
*** 392,403 ****
else if( mounted && ( id == 0x0D || id == 0x14 ) )
id = 0x1D;
!
// Attack (1H,Side,Down) + Cast Directed
else if( mounted && ( id == 0x09 || id == 0x0a ||id == 0x0b ||id == 0x10 ) )
id = 0x1A;
!
// Bow + Salute + Eat
else if( mounted && ( id == 0x13 || id == 0x20 || id == 0x21 || id == 0x22 ) )
! id = 0x1C;
else if( ( mounted || bodyID_ < 0x190 ) && ( bodyID_ == 0x22 ) )
--- 392,403 ----
else if( mounted && ( id == 0x0D || id == 0x14 ) )
id = 0x1D;
!
// Attack (1H,Side,Down) + Cast Directed
else if( mounted && ( id == 0x09 || id == 0x0a ||id == 0x0b ||id == 0x10 ) )
id = 0x1A;
!
// Bow + Salute + Eat
else if( mounted && ( id == 0x13 || id == 0x20 || id == 0x21 || id == 0x22 ) )
! id = 0x1C;
else if( ( mounted || bodyID_ < 0x190 ) && ( bodyID_ == 0x22 ) )
***************
*** 422,426 ****
{
// Check if we have something on our right hand
! P_ITEM rightHand = rightHandItem();
if( Combat::weaponSkill( rightHand ) != WRESTLING )
return rightHand;
--- 422,426 ----
{
// Check if we have something on our right hand
! P_ITEM rightHand = rightHandItem();
if( Combat::weaponSkill( rightHand ) != WRESTLING )
return rightHand;
***************
*** 442,447 ****
}
! void cBaseChar::setHairColor( UINT16 d)
! {
changed_ = true;
cItem* pHair = GetItemOnLayer( 11 );
--- 442,447 ----
}
! void cBaseChar::setHairColor( UINT16 d)
! {
changed_ = true;
cItem* pHair = GetItemOnLayer( 11 );
***************
*** 452,457 ****
}
! void cBaseChar::setHairStyle( UINT16 d)
! {
if( !isHair( d ) )
return;
--- 452,457 ----
}
! void cBaseChar::setHairStyle( UINT16 d)
! {
if( !isHair( d ) )
return;
***************
*** 476,481 ****
}
! void cBaseChar::setBeardColor( UINT16 d)
! {
changed_ = true;
cItem* pBeard = GetItemOnLayer( 16 );
--- 476,481 ----
}
! void cBaseChar::setBeardColor( UINT16 d)
! {
changed_ = true;
cItem* pBeard = GetItemOnLayer( 16 );
***************
*** 486,491 ****
}
! void cBaseChar::setBeardStyle( UINT16 d)
! {
if( !isBeard( d ) )
return;
--- 486,491 ----
}
! void cBaseChar::setBeardStyle( UINT16 d)
! {
if( !isBeard( d ) )
return;
***************
*** 539,543 ****
}
! // This should check soon if we are standing above our
// corpse and if so, merge with our corpse instead of
// just resurrecting
--- 539,543 ----
}
! // This should check soon if we are standing above our
// corpse and if so, merge with our corpse instead of
// just resurrecting
***************
*** 569,573 ****
pRobe = cItem::createFromScript( "1f03" );
! if( !pRobe )
return;
--- 569,573 ----
pRobe = cItem::createFromScript( "1f03" );
! if( !pRobe )
return;
***************
*** 588,608 ****
UINT8 nDir;
! if( xdif == 0 && ydif < 0 )
nDir = 0;
! else if( xdif > 0 && ydif < 0 )
nDir = 1;
! else if( xdif > 0 && ydif ==0 )
nDir = 2;
! else if( xdif > 0 && ydif > 0 )
nDir = 3;
! else if( xdif ==0 && ydif > 0 )
nDir = 4;
! else if( xdif < 0 && ydif > 0 )
nDir = 5;
! else if( xdif < 0 && ydif ==0 )
nDir = 6;
! else if( xdif < 0 && ydif < 0 )
nDir = 7;
! else
return;
--- 588,608 ----
UINT8 nDir;
! if( xdif == 0 && ydif < 0 )
nDir = 0;
! else if( xdif > 0 && ydif < 0 )
nDir = 1;
! else if( xdif > 0 && ydif ==0 )
nDir = 2;
! else if( xdif > 0 && ydif > 0 )
nDir = 3;
! else if( xdif ==0 && ydif > 0 )
nDir = 4;
! else if( xdif < 0 && ydif > 0 )
nDir = 5;
! else if( xdif < 0 && ydif ==0 )
nDir = 6;
! else if( xdif < 0 && ydif < 0 )
nDir = 7;
! else
return;
***************
*** 628,632 ****
if( !pi->container() )
! {
pi->setLayer( 0 );
if( !layer )
--- 628,632 ----
if( !pi->container() )
! {
pi->setLayer( 0 );
if( !layer )
***************
*** 647,651 ****
packet.fromItem( pi );
for ( cUOSocket* socket = cNetwork::instance()->first(); socket != 0; socket = cNetwork::instance()->next() )
! if( socket->player() && socket->player()->inRange( this, socket->player()->visualRange() ) )
socket->send( &packet );
}
--- 647,651 ----
packet.fromItem( pi );
for ( cUOSocket* socket = cNetwork::instance()->first(); socket != 0; socket = cNetwork::instance()->next() )
! if( socket->player() && socket->player()->inRange( this, socket->player()->visualRange() ) )
socket->send( &packet );
}
***************
*** 682,686 ****
P_ITEM pi = getBackpack();
!
if( pi )
number = pi->CountItems( ID, col );
--- 682,686 ----
P_ITEM pi = getBackpack();
!
if( pi )
number = pi->CountItems( ID, col );
***************
*** 698,702 ****
}
! P_ITEM cBaseChar::getBackpack()
{
P_ITEM backpack = atLayer( Backpack );
--- 698,702 ----
}
! P_ITEM cBaseChar::getBackpack()
{
P_ITEM backpack = atLayer( Backpack );
***************
*** 729,733 ****
cUObject::setSerial( ser );
!
World::instance()->registerObject( this );
}
--- 729,733 ----
cUObject::setSerial( ser );
!
World::instance()->registerObject( this );
}
***************
*** 741,747 ****
}
! bool cBaseChar::Wears(P_ITEM pi)
! {
! return (this == pi->container());
}
--- 741,747 ----
}
! bool cBaseChar::Wears(P_ITEM pi)
! {
! return (this == pi->container());
}
***************
*** 789,793 ****
textSpeech.setColor( color );
textSpeech.setText( emote );
!
for( cUOSocket *mSock = cNetwork::instance()->first(); mSock; mSock = cNetwork::instance()->next() )
if( mSock->player() && mSock->player()->inRange( this, mSock->player()->visualRange() ) )
--- 789,793 ----
textSpeech.setColor( color );
textSpeech.setText( emote );
!
for( cUOSocket *mSock = cNetwork::instance()->first(); mSock; mSock = cNetwork::instance()->next() )
if( mSock->player() && mSock->player()->inRange( this, mSock->player()->visualRange() ) )
***************
*** 797,801 ****
UI16 cBaseChar::calcDefense( enBodyParts bodypart, bool wearout )
{
! P_ITEM pHitItem = NULL;
UI16 total = bodyArmor_; // the body armor is base value
--- 797,801 ----
UI16 cBaseChar::calcDefense( enBodyParts bodypart, bool wearout )
{
! P_ITEM pHitItem = NULL;
UI16 total = bodyArmor_; // the body armor is base value
***************
*** 803,816 ****
{
P_ITEM pShield = leftHandItem();
!
! // Displayed AR = ((Parrying Skill * Base AR of Shield) ÷ 200) + 1
if( pShield && IsShield( pShield->id() ) )
total += ( (UI16)( (float)( skillValue( PARRYING ) * pShield->def() ) / 200.0f ) + 1 );
! }
! if( skillValue( PARRYING ) >= 1000 )
! total += 5; // gm parry bonus.
! P_ITEM pi;
ItemContainer::const_iterator it = content_.begin();
--- 803,816 ----
{
P_ITEM pShield = leftHandItem();
!
! // Displayed AR = ((Parrying Skill * Base AR of Shield) �200) + 1
if( pShield && IsShield( pShield->id() ) )
total += ( (UI16)( (float)( skillValue( PARRYING ) * pShield->def() ) / 200.0f ) + 1 );
! }
! if( skillValue( PARRYING ) >= 1000 )
! total += 5; // gm parry bonus.
! P_ITEM pi;
ItemContainer::const_iterator it = content_.begin();
***************
*** 818,826 ****
{
pi = *it;
! if( pi && pi->layer() > 1 && pi->layer() < 25 )
! {
! //blackwinds new stuff
UI16 effdef = 0;
! if( pi->maxhp() > 0 )
effdef = (UI16)( (float)pi->hp() / (float)pi->maxhp() * (float)pi->def() );
--- 818,826 ----
{
pi = *it;
! if( pi && pi->layer() > 1 && pi->layer() < 25 )
! {
! //blackwinds new stuff
UI16 effdef = 0;
! if( pi->maxhp() > 0 )
effdef = (UI16)( (float)pi->hp() / (float)pi->maxhp() * (float)pi->def() );
***************
*** 834,903 ****
}
}
! else
! {
! switch( pi->layer() )
! {
! case 5:
! case 13:
! case 17:
! case 20:
! case 22:
! if( bodypart == BODY )
! {
! total += effdef;
! pHitItem = pi;
! }
! break;
! case 19:
! if( bodypart == ARMS )
! {
! total += effdef;
! pHitItem = pi;
! }
! break;
! case 6:
! if( bodypart == HEAD )
! {
! total += effdef;
! pHitItem = pi;
! }
! break;
! case 3:
! case 4:
! case 12:
! case 23:
! case 24:
if( bodypart == LEGS )
! {
! total += effdef;
! pHitItem = pi;
! }
! break;
! case 10:
! if( bodypart == NECK )
! {
! total += effdef;
! pHitItem = pi;
! }
! break;
! case 7:
if( bodypart == HANDS )
! {
! total += effdef;
! pHitItem = pi;
! }
! break;
! default:
! break;
! }
}
}
++it;
! }
! if( pHitItem )
! {
! // don't damage hairs, beard and backpack
! // important! this sometimes cause backpack destroy!
if( pHitItem->layer() != 0x0B && pHitItem->layer() != 0x10 && pHitItem->layer() != 0x15 )
{
--- 834,903 ----
}
}
! else
! {
! switch( pi->layer() )
! {
! case 5:
! case 13:
! case 17:
! case 20:
! case 22:
! if( bodypart == BODY )
! {
! total += effdef;
! pHitItem = pi;
! }
! break;
! case 19:
! if( bodypart == ARMS )
! {
! total += effdef;
! pHitItem = pi;
! }
! break;
! case 6:
! if( bodypart == HEAD )
! {
! total += effdef;
! pHitItem = pi;
! }
! break;
! case 3:
! case 4:
! case 12:
! case 23:
! case 24:
if( bodypart == LEGS )
! {
! total += effdef;
! pHitItem = pi;
! }
! break;
! case 10:
! if( bodypart == NECK )
! {
! total += effdef;
! pHitItem = pi;
! }
! break;
! case 7:
if( bodypart == HANDS )
! {
! total += effdef;
! pHitItem = pi;
! }
! break;
! default:
! break;
! }
}
}
++it;
! }
! if( pHitItem )
! {
! // don't damage hairs, beard and backpack
! // important! this sometimes cause backpack destroy!
if( pHitItem->layer() != 0x0B && pHitItem->layer() != 0x10 && pHitItem->layer() != 0x15 )
{
***************
*** 905,911 ****
}
}
!
// Base AR ?
! /*if( total < 2 && bodypart == ALLBODYPARTS )
total = 2;*/
--- 905,911 ----
}
}
!
// Base AR ?
! /*if( total < 2 && bodypart == ALLBODYPARTS )
total = 2;*/
***************
*** 916,920 ****
{
bool success = false;
!
// Maximum Value of 120 for checks
// I disabled this so you can make skillchecks for grandmasters that are still tough
--- 916,920 ----
{
bool success = false;
!
// Maximum Value of 120 for checks
// I disabled this so you can make skillchecks for grandmasters that are still tough
***************
*** 923,928 ****
// How far is the players skill above the required minimum.
! int charrange = skillValue( skill ) - min;
!
if( charrange < 0 )
charrange = 0;
--- 923,928 ----
// How far is the players skill above the required minimum.
! int charrange = skillValue( skill ) - min;
!
if( charrange < 0 )
charrange = 0;
***************
*** 934,944 ****
// +100 means: *allways* a minimum of 10% for success
float chance = ( ( (float) charrange * 890.0f ) / (float)( max - min ) ) + 100.0f;
!
! if( chance > 990 )
chance = 990; // *allways* a 1% chance of failure
!
if( chance >= RandomNum( 0, 1000 ) )
success = true;
!
return success;
}
--- 934,944 ----
// +100 means: *allways* a minimum of 10% for success
float chance = ( ( (float) charrange * 890.0f ) / (float)( max - min ) ) + 100.0f;
!
! if( chance > 990 )
chance = 990; // *allways* a 1% chance of failure
!
if( chance >= RandomNum( 0, 1000 ) )
success = true;
!
return success;
}
***************
*** 1007,1011 ****
}
++iter;
! }
}
--- 1007,1011 ----
}
++iter;
! }
}
***************
*** 1021,1025 ****
if( TagName == "bindmenu" )
{
! if( !Tag->getAttribute( "id" ).isNull() )
this->setBindmenu(Tag->getAttribute( "id" ));
else
--- 1021,1025 ----
if( TagName == "bindmenu" )
{
! if( !Tag->getAttribute( "id" ).isNull() )
this->setBindmenu(Tag->getAttribute( "id" ));
else
***************
*** 1102,1106 ****
stamina_ = maxStamina_;
}
!
else if( TagName == "int" )
{
--- 1102,1106 ----
stamina_ = maxStamina_;
}
!
else if( TagName == "int" )
{
***************
*** 1194,1198 ****
mLayer = tInfo.layer;
}
!
if( !mLayer )
pItem->remove();
--- 1194,1198 ----
mLayer = tInfo.layer;
}
!
if( !mLayer )
pItem->remove();
***************
*** 1221,1225 ****
setSkillValue( skillId, Value.toInt() );
}
!
}
--- 1221,1225 ----
setSkillValue( skillId, Value.toInt() );
}
!
}
***************
*** 1228,1232 ****
// DoubleEquip is *NOT* allowed
if ( atLayer( layer ) != 0 )
! {
log( LOG_WARNING, QString( "Trying to put an item on layer %1 which is already occupied\n" ).arg( layer ) );
pi->setContainer( 0 );
--- 1228,1232 ----
// DoubleEquip is *NOT* allowed
if ( atLayer( layer ) != 0 )
! {
log( LOG_WARNING, QString( "Trying to put an item on layer %1 which is already occupied\n" ).arg( layer ) );
pi->setContainer( 0 );
***************
*** 1239,1243 ****
if( layer != Dragging )
pi->onEquip( this, layer );
! pi->removeFromCont();
}
--- 1239,1243 ----
if( layer != Dragging )
pi->onEquip( this, layer );
! pi->removeFromCont();
}
***************
*** 1516,1520 ****
else GET_PROPERTY( "invisible", isInvisible() )
else GET_PROPERTY( "frozen", isFrozen() )
!
// skill.
else if( name.left( 6 ) == "skill." )
--- 1516,1520 ----
else GET_PROPERTY( "invisible", isInvisible() )
else GET_PROPERTY( "frozen", isFrozen() )
!
// skill.
else if( name.left( 6 ) == "skill." )
***************
*** 1638,1647 ****
{
PyObject *args;
!
if( dynamic_cast< P_CHAR >( source ) != 0 )
args = Py_BuildValue( "O&iiO&", PyGetCharObject, this, (unsigned int)type, amount, PyGetCharObject, source );
else if( dynamic_cast< P_ITEM >( source ) )
args = Py_BuildValue( "O&iiO&", PyGetCharObject, this, (unsigned int)type, amount, PyGetItemObject, source );
!
PyObject *result = cPythonScript::callChainedEvent( EVENT_DAMAGE, scriptChain, args );
--- 1638,1647 ----
{
PyObject *args;
!
if( dynamic_cast< P_CHAR >( source ) != 0 )
args = Py_BuildValue( "O&iiO&", PyGetCharObject, this, (unsigned int)type, amount, PyGetCharObject, source );
else if( dynamic_cast< P_ITEM >( source ) )
args = Py_BuildValue( "O&iiO&", PyGetCharObject, this, (unsigned int)type, amount, PyGetItemObject, source );
!
PyObject *result = cPythonScript::callChainedEvent( EVENT_DAMAGE, scriptChain, args );
***************
*** 1675,1679 ****
updateHealth();
Combat::playGetHitSoundEffect( this );
! Combat::playGetHitAnimation( this );
}
--- 1675,1679 ----
updateHealth();
Combat::playGetHitSoundEffect( this );
! Combat::playGetHitAnimation( this );
}
***************
*** 1717,1721 ****
if( type == Bark_GetHit )
return;
!
// Only Attack, Hit, GetHit and Death
case 3:
--- 1717,1721 ----
if( type == Bark_GetHit )
return;
!
// Only Attack, Hit, GetHit and Death
case 3:
***************
*** 1844,1848 ****
{
bool result = false;
!
if( scriptChain )
{
--- 1844,1848 ----
{
bool result = false;
!
if( scriptChain )
{
***************
*** 1858,1862 ****
{
bool result = false;
!
if( scriptChain )
{
--- 1858,1862 ----
{
bool result = false;
!
if( scriptChain )
{
***************
*** 1872,1876 ****
{
bool result = false;
!
if( scriptChain )
{
--- 1872,1876 ----
{
bool result = false;
!
if( scriptChain )
{
***************
*** 1886,1890 ****
{
bool result = false;
!
if( scriptChain )
{
--- 1886,1890 ----
{
bool result = false;
!
if( scriptChain )
{
***************
*** 1902,1910 ****
}
! bool cBaseChar::onSkillUse( unsigned char skill )
{
cPythonScript *global = ScriptManager::instance()->getGlobalHook( EVENT_SKILLUSE );
bool result = false;
!
if( scriptChain || global )
{
--- 1902,1910 ----
}
! bool cBaseChar::onSkillUse( unsigned char skill )
{
cPythonScript *global = ScriptManager::instance()->getGlobalHook( EVENT_SKILLUSE );
bool result = false;
!
if( scriptChain || global )
{
***************
*** 1925,1929 ****
{
bool result = false;
!
if( scriptChain )
{
--- 1925,1929 ----
{
bool result = false;
!
if( scriptChain )
{
***************
*** 1967,1971 ****
{
bool result = false;
!
if( scriptChain )
{
--- 1967,1971 ----
{
bool result = false;
!
if( scriptChain )
{
***************
*** 1981,1985 ****
cPythonScript *global = ScriptManager::instance()->getGlobalHook( EVENT_CHLEVELCHANGE );
bool result = false;
!
if( scriptChain || global )
{
--- 1981,1985 ----
cPythonScript *global = ScriptManager::instance()->getGlobalHook( EVENT_CHLEVELCHANGE );
bool result = false;
!
if( scriptChain || global )
{
***************
*** 2001,2005 ****
cPythonScript *global = ScriptManager::instance()->getGlobalHook( EVENT_SHOWTOOLTIP );
bool result = false;
!
if( scriptChain || global )
{
--- 2001,2005 ----
cPythonScript *global = ScriptManager::instance()->getGlobalHook( EVENT_SHOWTOOLTIP );
bool result = false;
!
if( scriptChain || global )
{
***************
*** 2021,2025 ****
cPythonScript *global = ScriptManager::instance()->getGlobalHook( EVENT_SKILLGAIN );
bool result = false;
!
if( scriptChain || global )
{
--- 2021,2025 ----
cPythonScript *global = ScriptManager::instance()->getGlobalHook( EVENT_SKILLGAIN );
bool result = false;
!
if( scriptChain || global )
{
***************
*** 2041,2045 ****
cPythonScript *global = ScriptManager::instance()->getGlobalHook( EVENT_STATGAIN );
bool result = false;
!
if( scriptChain || global )
{
--- 2041,2045 ----
cPythonScript *global = ScriptManager::instance()->getGlobalHook( EVENT_STATGAIN );
bool result = false;
!
if( scriptChain || global )
{
Index: boats.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/boats.cpp,v
retrieving revision 1.116
retrieving revision 1.117
diff -C2 -d -r1.116 -r1.117
*** boats.cpp 24 Sep 2003 21:19:47 -0000 1.116
--- boats.cpp 30 Jan 2004 20:29:26 -0000 1.117
***************
*** 53,57 ****
#undef DBGFILE
! #define DBGFILE "boats.cpp"
cBoat::cBoat() : cMulti()
--- 53,57 ----
#undef DBGFILE
! #define DBGFILE "boats.cpp"
cBoat::cBoat() : cMulti()
***************
*** 69,73 ****
this->itemids[2][0] = this->itemids[0][2] = 0x3EB2;
this->itemids[3][0] = this->itemids[1][2] = 0x3E85;
!
this->itemids[0][1] = this->itemids[2][3] = 0x3ED5;
this->itemids[1][1] = this->itemids[3][3] = 0x3E89;
--- 69,73 ----
this->itemids[2][0] = this->itemids[0][2] = 0x3EB2;
this->itemids[3][0] = this->itemids[1][2] = 0x3E85;
!
this->itemids[0][1] = this->itemids[2][3] = 0x3ED5;
this->itemids[1][1] = this->itemids[3][3] = 0x3E89;
***************
*** 162,168 ****
pTiller->setTag("gatetime", (int)(uiCurrentTime + (double)(SrvParams->boatSpeed()*MY_CLOCKS_PER_SEC)));
}
!
P_ITEM pPlankR = cItem::createFromId( this->itemids[0][ PORT_P_C ] );
! if( !pPlankR )
siproblem = 1;
else
--- 162,168 ----
pTiller->setTag("gatetime", (int)(uiCurrentTime + (double)(SrvParams->boatSpeed()*MY_CLOCKS_PER_SEC)));
}
!
P_ITEM pPlankR = cItem::createFromId( this->itemids[0][ PORT_P_C ] );
! if( !pPlankR )
siproblem = 1;
else
***************
*** 241,245 ****
socket->send( &uoResume );
}
!
this->SetOwnSerial( pc_currchar->serial() );
}
--- 241,245 ----
socket->send( &uoResume );
}
!
this->SetOwnSerial( pc_currchar->serial() );
}
***************
*** 373,377 ****
coord = Y;
}
!
if( coord < 0xFF )
{
--- 373,377 ----
coord = Y;
}
!
if( coord < 0xFF )
{
***************
*** 415,425 ****
if( mapblocks )
return false;
!
/*
RegionIterator4It...
[truncated message content] |