Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv12498
Modified Files:
house.cpp npc.cpp player.cpp targetrequests.cpp
Log Message:
Further improved baseid conformance.
Index: house.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/house.cpp,v
retrieving revision 1.117
retrieving revision 1.118
diff -C2 -d -r1.117 -r1.118
*** house.cpp 24 Nov 2003 03:14:52 -0000 1.117
--- house.cpp 26 Nov 2003 01:12:20 -0000 1.118
***************
*** 29,34 ****
//==================================================================================
! /* House code for deed creation by Tal Strake, revised by Cironian */
!
#include "house.h"
#include "persistentbroker.h"
--- 29,33 ----
//==================================================================================
! #include "console.h"
#include "house.h"
#include "persistentbroker.h"
***************
*** 59,113 ****
void cHouse::processHouseItemNode( const cElement *Tag )
{
! P_CHAR pOwner = FindCharBySerial( ownSerial() );
! P_ITEM nItem = new cItem;
! if( !nItem )
! return;
!
! nItem->Init( true );
! nItem->applyDefinition( Tag );
! if( nItem->type() == 222 )
! nItem->setName( name() );
! nItem->SetOwnSerial( this->ownSerial() );
! addItem( nItem );
! Coord_cl npos = this->pos();
! for( unsigned int i = 0; i < Tag->childCount(); ++i )
! {
! const cElement *childTag = Tag->getChild( i );
!
! QString TagName = childTag->name();
! QString Value = childTag->getValue();
! // <pack />
! if( TagName == "pack" && pOwner )
{
! P_ITEM pBackpack = pOwner->getBackpack();
! pBackpack->addItem( nItem );
! }
! // <lock />
! else if( TagName == "lock" )
! {
! nItem->setMagic(4);
! }
! // <secure />
! else if( TagName == "secure" )
! nItem->setMagic(3);
! // <position x="1" y="5" z="20" />
! else if( TagName == "position" )
! {
! npos.x = npos.x + childTag->getAttribute( "x" ).toShort();
! npos.y = npos.y + childTag->getAttribute( "y" ).toShort();
! npos.z = npos.z + childTag->getAttribute( "z" ).toShort();
}
- }
! nItem->moveTo( npos );
! nItem->update();
}
--- 58,121 ----
void cHouse::processHouseItemNode( const cElement *Tag )
{
! const QString &id = Tag->getAttribute( "id" );
! P_ITEM nItem = 0;
! if( id != QString::null )
! {
! nItem = cItem::createFromScript( id );
! }
! if( nItem )
! {
! P_CHAR pOwner = FindCharBySerial( ownSerial() );
! nItem->applyDefinition( Tag );
! if( nItem->type() == 222 )
! nItem->setName( name() );
! nItem->SetOwnSerial( this->ownSerial() );
! addItem( nItem );
! Coord_cl npos = this->pos();
! for( unsigned int i = 0; i < Tag->childCount(); ++i )
{
! const cElement *childTag = Tag->getChild( i );
!
! QString TagName = childTag->name();
! QString Value = childTag->getValue();
! // <pack />
! if( TagName == "pack" && pOwner )
! {
! P_ITEM pBackpack = pOwner->getBackpack();
! pBackpack->addItem( nItem );
! }
! // <lock />
! else if( TagName == "lock" )
! {
! nItem->setMagic(4);
! }
! // <secure />
! else if( TagName == "secure" )
! nItem->setMagic(3);
!
! // <position x="1" y="5" z="20" />
! else if( TagName == "position" )
! {
! npos.x = npos.x + childTag->getAttribute( "x" ).toShort();
! npos.y = npos.y + childTag->getAttribute( "y" ).toShort();
! npos.z = npos.z + childTag->getAttribute( "z" ).toShort();
! }
}
! nItem->moveTo( npos );
! nItem->update();
! }
! else
! {
! Console::instance()->log( LOG_ERROR, QString( "Invalid item node missing id attribute in multi '%1'." ).arg( Tag->getTopmostParent()->getAttribute( "id", "unknown" ) ) );
! }
}
Index: npc.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** npc.cpp 24 Nov 2003 03:14:52 -0000 1.51
--- npc.cpp 26 Nov 2003 01:12:20 -0000 1.52
***************
*** 808,814 ****
while( total > 0 )
{
! P_ITEM pile = new cItem;
! pile->Init();
! pile->setId( 0xEED );
pile->setAmount( QMIN( total, static_cast<Q_UINT32>(65535) ) );
pCont->addItem( pile );
--- 808,812 ----
while( total > 0 )
{
! P_ITEM pile = cItem::createFromScript( "eed" );
pile->setAmount( QMIN( total, static_cast<Q_UINT32>(65535) ) );
pCont->addItem( pile );
***************
*** 1473,1481 ****
if( !currCont )
{
! currCont = new cItem;
! currCont->Init();
! currCont->setId( 0xE75 );
currCont->setOwner( this );
- currCont->setType( 1 );
addItem( BuyRestockContainer, currCont );
currCont->update();
--- 1471,1476 ----
if( !currCont )
{
! currCont = cItem::createFromScript( "e75" );
currCont->setOwner( this );
addItem( BuyRestockContainer, currCont );
currCont->update();
***************
*** 1485,1493 ****
if( !currCont )
{
! currCont = new cItem;
! currCont->Init();
! currCont->setId( 0xE75 );
currCont->setOwner( this );
- currCont->setType( 1 );
addItem( BuyNoRestockContainer, currCont );
currCont->update();
--- 1480,1485 ----
if( !currCont )
{
! currCont = cItem::createFromScript( "e75" );
currCont->setOwner( this );
addItem( BuyNoRestockContainer, currCont );
currCont->update();
***************
*** 1497,1505 ****
if( !currCont )
{
! currCont = new cItem;
! currCont->Init();
! currCont->setId( 0xE75 );
currCont->setOwner( this );
- currCont->setType( 1 );
addItem( SellContainer, currCont );
currCont->update();
--- 1489,1494 ----
if( !currCont )
{
! currCont = cItem::createFromScript( "e75" );
currCont->setOwner( this );
addItem( SellContainer, currCont );
currCont->update();
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** player.cpp 25 Nov 2003 19:41:30 -0000 1.50
--- player.cpp 26 Nov 2003 01:12:20 -0000 1.51
***************
*** 982,995 ****
P_ITEM pi = atLayer( BankBox );
! if ( pi )
! return pi;
!
! pi = new cItem;
! pi->Init();
! pi->setId( 0x9ab );
! pi->SetOwnSerial( this->serial() );
! pi->setType( 1 );
! pi->setName( tr( "%1's bank box" ).arg( name() ) );
! addItem( BankBox, pi, true, true );
return pi;
--- 982,993 ----
P_ITEM pi = atLayer( BankBox );
! if( !pi )
! {
! pi = cItem::createFromScript( "9ab" );
! pi->setOwner( this );
! pi->setType( 1 );
! pi->setName( tr( "%1's bank box" ).arg( name() ) );
! addItem( BankBox, pi, true, true );
! }
return pi;
Index: targetrequests.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/targetrequests.cpp,v
retrieving revision 1.79
retrieving revision 1.80
diff -C2 -d -r1.79 -r1.80
*** targetrequests.cpp 23 Sep 2003 12:40:19 -0000 1.79
--- targetrequests.cpp 26 Nov 2003 01:12:20 -0000 1.80
***************
*** 77,81 ****
// Otherwise create our item here
! P_ITEM pItem = NULL;
if( node )
pItem = cItem::createFromScript( item_ );
--- 77,82 ----
// Otherwise create our item here
! P_ITEM pItem = 0;
!
if( node )
pItem = cItem::createFromScript( item_ );
|