Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11944
Modified Files:
ChangeLog basechar.cpp content.cpp content.h dragdrop.cpp
items.cpp pythonscript.cpp spawnregions.cpp uobject.cpp
Log Message:
Bugfixes
Index: content.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/content.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** content.h 3 Nov 2004 03:34:15 -0000 1.2
--- content.h 3 Nov 2004 13:51:08 -0000 1.3
***************
*** 28,38 ****
private:
cItem **content;
public:
! ContainerContent(const ContainerContent &src) {
// Copy content
if (!src.content) {
content = 0;
} else {
! size_t count = src.maxCount() + 2; // How many slots
content = new cItem* [count];
for (size_t i = 0; i < count; ++i) {
--- 28,43 ----
private:
cItem **content;
+
+ ContainerContent(const ContainerContent &src) {
+ }
public:
!
! // Copy the content.
! ContainerContent &operator =(const ContainerContent &src) {
// Copy content
if (!src.content) {
content = 0;
} else {
! size_t count = src.maxCount(); // How many slots
content = new cItem* [count];
for (size_t i = 0; i < count; ++i) {
***************
*** 40,43 ****
--- 45,50 ----
}
}
+
+ return *this;
}
Index: dragdrop.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dragdrop.cpp,v
retrieving revision 1.250
retrieving revision 1.251
diff -C2 -d -r1.250 -r1.251
*** dragdrop.cpp 3 Nov 2004 02:09:26 -0000 1.250
--- dragdrop.cpp 3 Nov 2004 13:51:08 -0000 1.251
***************
*** 618,622 ****
pItem->removeFromCont();
! pItem->moveTo( pos );
pItem->update();
--- 618,622 ----
pItem->removeFromCont();
! pItem->moveTo( pos, true );
pItem->update();
***************
*** 806,810 ****
{
pItem->removeFromCont();
! pItem->moveTo( pCont->pos() + Coord( 0, 0, 2 ) );
}
--- 806,810 ----
{
pItem->removeFromCont();
! pItem->moveTo( pCont->pos() + Coord( 0, 0, 2 ), true );
}
Index: basechar.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v
retrieving revision 1.173
retrieving revision 1.174
diff -C2 -d -r1.173 -r1.174
*** basechar.cpp 3 Nov 2004 02:09:23 -0000 1.173
--- basechar.cpp 3 Nov 2004 13:51:08 -0000 1.174
***************
*** 206,210 ****
propertyFlags_ = reader.readInt();
murdererSerial_ = reader.readInt();
! guarding_ = reinterpret_cast<P_CHAR>( reader.readInt() ); // PostProcess
hitpointsBonus_ = reader.readShort();
staminaBonus_ = reader.readShort();
--- 206,210 ----
propertyFlags_ = reader.readInt();
murdererSerial_ = reader.readInt();
! guarding_ = reinterpret_cast<P_CHAR>( static_cast<size_t>(reader.readInt()) ); // PostProcess
hitpointsBonus_ = reader.readShort();
staminaBonus_ = reader.readShort();
***************
*** 231,235 ****
{
// Resolve the guarding_ value.
! SERIAL guarding = ( SERIAL ) guarding_;
guarding_ = 0;
setGuarding( World::instance()->findChar( guarding ) );
--- 231,235 ----
{
// Resolve the guarding_ value.
! SERIAL guarding = static_cast<SERIAL>( reinterpret_cast<size_t>( guarding_ ) );
guarding_ = 0;
setGuarding( World::instance()->findChar( guarding ) );
***************
*** 2880,2884 ****
else
{
! item->moveTo( pos_ );
item->update();
}
--- 2880,2884 ----
else
{
! item->moveTo( pos_, true );
item->update();
}
Index: uobject.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/uobject.cpp,v
retrieving revision 1.190
retrieving revision 1.191
diff -C2 -d -r1.190 -r1.191
*** uobject.cpp 3 Nov 2004 02:09:28 -0000 1.190
--- uobject.cpp 3 Nov 2004 13:51:11 -0000 1.191
***************
*** 66,71 ****
if ( isScriptChainFrozen() )
{
! unsigned int count = reinterpret_cast<unsigned int>( scriptChain[0] );
! for ( unsigned int i = 1; i <= count; ++i )
{
QCString* str = reinterpret_cast<QCString*>( scriptChain[i] );
--- 66,71 ----
if ( isScriptChainFrozen() )
{
! size_t count = reinterpret_cast<size_t>( scriptChain[0] );
! for ( size_t i = 1; i <= count; ++i )
{
QCString* str = reinterpret_cast<QCString*>( scriptChain[i] );
***************
*** 83,87 ****
if ( src.scriptChain )
{
! unsigned int count = reinterpret_cast<unsigned int>( src.scriptChain[0] );
scriptChain = new cPythonScript * [count + 1];
memcpy( scriptChain, src.scriptChain, ( count + 1 ) * sizeof( cPythonScript * ) );
--- 83,87 ----
if ( src.scriptChain )
{
! size_t count = reinterpret_cast<size_t>( src.scriptChain[0] );
scriptChain = new cPythonScript * [count + 1];
memcpy( scriptChain, src.scriptChain, ( count + 1 ) * sizeof( cPythonScript * ) );
***************
*** 163,167 ****
offset++;
serial_ = atoi( result[offset++] );
! multi_ = reinterpret_cast<cMulti*>( atoi( result[offset++] ) );
pos_.x = atoi( result[offset++] );
pos_.y = atoi( result[offset++] );
--- 163,167 ----
offset++;
serial_ = atoi( result[offset++] );
! multi_ = reinterpret_cast<cMulti*>( static_cast<size_t>(atoi(result[offset++])) );
pos_.x = atoi( result[offset++] );
pos_.y = atoi( result[offset++] );
***************
*** 302,307 ****
if ( frozen && myChain )
{
! unsigned int count = reinterpret_cast<unsigned int>( myChain[0] );
! for ( unsigned int i = 1; i <= count; ++i )
{
QCString* str = reinterpret_cast<QCString*>( myChain[i] );
--- 302,307 ----
if ( frozen && myChain )
{
! size_t count = reinterpret_cast<size_t>( myChain[0] );
! for ( size_t i = 1; i <= count; ++i )
{
QCString* str = reinterpret_cast<QCString*>( myChain[i] );
***************
*** 330,336 ****
if ( scriptChain )
{
! unsigned int count = reinterpret_cast<unsigned int>( scriptChain[0] );
! for ( unsigned int i = 1; i <= count; ++i )
{
if ( scriptChain[i]->name() == name )
--- 330,336 ----
if ( scriptChain )
{
! size_t count = reinterpret_cast<size_t>( scriptChain[0] );
! for ( size_t i = 1; i <= count; ++i )
{
if ( scriptChain[i]->name() == name )
***************
*** 360,364 ****
if ( scriptChain )
{
! unsigned int count = reinterpret_cast<unsigned int>( *scriptChain );
cPythonScript** newScriptChain = new cPythonScript* [count + 2];
--- 360,364 ----
if ( scriptChain )
{
! size_t count = reinterpret_cast<size_t>( *scriptChain );
cPythonScript** newScriptChain = new cPythonScript* [count + 2];
***************
*** 408,414 ****
bool found = false;
if (scriptChain) {
! unsigned int count = reinterpret_cast<unsigned int>( scriptChain[0] );
! for ( unsigned int i = 1; i <= count; ++i )
{
if ( scriptChain[i]->name() == name )
--- 408,414 ----
bool found = false;
if (scriptChain) {
! size_t count = reinterpret_cast<size_t>( scriptChain[0] );
! for ( size_t i = 1; i <= count; ++i )
{
if ( scriptChain[i]->name() == name )
***************
*** 426,430 ****
if ( scriptChain )
{
! unsigned int count = reinterpret_cast<unsigned int>( scriptChain[0] );
if ( count == 1 )
--- 426,430 ----
if ( scriptChain )
{
! size_t count = reinterpret_cast<size_t>( scriptChain[0] );
if ( count == 1 )
***************
*** 439,443 ****
newScriptChain[0] = reinterpret_cast<cPythonScript*>( count - 1 );
! for ( unsigned int i = 1; i <= count; ++i )
{
if ( scriptChain[i]->name() != name )
--- 439,443 ----
newScriptChain[0] = reinterpret_cast<cPythonScript*>( count - 1 );
! for ( size_t i = 1; i <= count; ++i )
{
if ( scriptChain[i]->name() != name )
***************
*** 991,996 ****
}
! unsigned int count = reinterpret_cast<unsigned int>( scriptChain[0] );
! for ( unsigned int i = 1; i <= count; ++i )
{
QCString* name = new QCString( scriptChain[i]->name() );
--- 991,996 ----
}
! size_t count = reinterpret_cast<size_t>( scriptChain[0] );
! for ( size_t i = 1; i <= count; ++i )
{
QCString* name = new QCString( scriptChain[i]->name() );
***************
*** 1007,1015 ****
}
! unsigned int count = reinterpret_cast<unsigned int>( scriptChain[0] ) & ~0x80000000;
! unsigned int pos = 1;
scriptChain[0] = 0;
! for ( unsigned int i = 1; i <= count; ++i )
{
QCString* name = reinterpret_cast<QCString*>( scriptChain[i] );
--- 1007,1015 ----
}
! size_t count = reinterpret_cast<size_t>( scriptChain[0] ) & ~0x80000000;
! size_t pos = 1;
scriptChain[0] = 0;
! for ( size_t i = 1; i <= count; ++i )
{
QCString* name = reinterpret_cast<QCString*>( scriptChain[i] );
***************
*** 1038,1042 ****
}
! unsigned int count = reinterpret_cast<unsigned int>( scriptChain[0] );
return ( count & 0x80000000 ) != 0;
}
--- 1038,1042 ----
}
! size_t count = reinterpret_cast<size_t>( scriptChain[0] );
return ( count & 0x80000000 ) != 0;
}
***************
*** 1050,1055 ****
QCString result;
! unsigned int count = reinterpret_cast<unsigned int>( scriptChain[0] );
! for ( unsigned int i = 1; i <= count; ++i )
{
if ( i != count )
--- 1050,1055 ----
QCString result;
! size_t count = reinterpret_cast<size_t>( scriptChain[0] );
! for ( size_t i = 1; i <= count; ++i )
{
if ( i != count )
***************
*** 1075,1079 ****
QStringList events = QStringList::split( ",", eventlist );
! unsigned int i = 1;
QStringList::iterator it;
--- 1075,1079 ----
QStringList events = QStringList::split( ",", eventlist );
! size_t i = 1;
QStringList::iterator it;
Index: ChangeLog
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/ChangeLog,v
retrieving revision 1.130
retrieving revision 1.131
diff -C2 -d -r1.130 -r1.131
*** ChangeLog 3 Nov 2004 08:21:06 -0000 1.130
--- ChangeLog 3 Nov 2004 13:51:08 -0000 1.131
***************
*** 30,33 ****
--- 30,37 ----
- Region calls now list online and offline chars in seperate lists.
- Implemented player collision stamina loss in Felucca.
+ - Fixed lightlevel calculation.
+ - Fixed the pythonscript* <-> integer conversion warnings by using size_t instead.
+ - Fixed adding items to the MapObjects.
+ - Fixed a bug in the new ContainerCopyIterator.
Wolfpack 12.9.12 Beta (18. October 2004)
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.459
retrieving revision 1.460
diff -C2 -d -r1.459 -r1.460
*** items.cpp 3 Nov 2004 02:09:26 -0000 1.459
--- items.cpp 3 Nov 2004 13:51:08 -0000 1.460
***************
*** 129,133 ****
{
removeFromCont();
! moveTo( pChar->pos() );
}
// Or to the backpack
--- 129,133 ----
{
removeFromCont();
! moveTo( pChar->pos(), true );
}
// Or to the backpack
***************
*** 1100,1104 ****
else
{
! nItem->moveTo( pos_ );
}
return nItem;
--- 1100,1104 ----
else
{
! nItem->moveTo( pos_, true );
}
return nItem;
***************
*** 1333,1337 ****
if ( containerSerial != INVALID_SERIAL )
{
! container_ = reinterpret_cast<cUObject*>( containerSerial );
setUnprocessed( true );
}
--- 1333,1337 ----
if ( containerSerial != INVALID_SERIAL )
{
! container_ = reinterpret_cast<cUObject*>( static_cast<size_t>(containerSerial) );
setUnprocessed( true );
}
Index: spawnregions.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/spawnregions.cpp,v
retrieving revision 1.82
retrieving revision 1.83
diff -C2 -d -r1.82 -r1.83
*** spawnregions.cpp 3 Nov 2004 02:09:27 -0000 1.82
--- spawnregions.cpp 3 Nov 2004 13:51:10 -0000 1.83
***************
*** 642,646 ****
pItem->setSpawnregion(this);
pItem->setBaseid(id.latin1());
! pItem->moveTo( pos );
pItem->applyDefinition( parent ); // Apply the definition from the id first
--- 642,646 ----
pItem->setSpawnregion(this);
pItem->setBaseid(id.latin1());
! pItem->moveTo( pos, true );
pItem->applyDefinition( parent ); // Apply the definition from the id first
Index: pythonscript.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/pythonscript.cpp,v
retrieving revision 1.59
retrieving revision 1.60
diff -C2 -d -r1.59 -r1.60
*** pythonscript.cpp 3 Nov 2004 02:09:26 -0000 1.59
--- pythonscript.cpp 3 Nov 2004 13:51:08 -0000 1.60
***************
*** 800,810 ****
{
// Measure
! unsigned int count = reinterpret_cast<unsigned int>( chain[0] );
cPythonScript** copy = new cPythonScript*[count];
! for ( unsigned int j = 0; j < count; ++j )
copy[j] = chain[j + 1];
// Find a valid handler function
! for ( unsigned int i = 0; i < count; ++i )
{
PyObject* result = copy[i]->callEvent( event, args );
--- 800,810 ----
{
// Measure
! size_t count = reinterpret_cast<size_t>( chain[0] );
cPythonScript** copy = new cPythonScript*[count];
! for ( size_t j = 0; j < count; ++j )
copy[j] = chain[j + 1];
// Find a valid handler function
! for ( size_t i = 0; i < count; ++i )
{
PyObject* result = copy[i]->callEvent( event, args );
***************
*** 836,846 ****
{
// Measure
! unsigned int count = reinterpret_cast<unsigned int>( chain[0] );
cPythonScript** copy = new cPythonScript*[count];
! for ( unsigned int j = 0; j < count; ++j )
copy[j] = chain[j + 1];
// Find a valid handler function
! for ( unsigned int i = 0; i < count; ++i )
{
result = copy[i]->callEvent( event, args );
--- 836,846 ----
{
// Measure
! size_t count = reinterpret_cast<size_t>( chain[0] );
cPythonScript** copy = new cPythonScript*[count];
! for ( size_t j = 0; j < count; ++j )
copy[j] = chain[j + 1];
// Find a valid handler function
! for ( size_t i = 0; i < count; ++i )
{
result = copy[i]->callEvent( event, args );
***************
*** 867,873 ****
if ( event < EVENT_COUNT )
{
! unsigned int count = reinterpret_cast<unsigned int>( *( chain++ ) );
! for ( unsigned int i = 0; i < count; ++i )
{
if ( chain[i]->canHandleEvent( event ) )
--- 867,873 ----
if ( event < EVENT_COUNT )
{
! size_t count = reinterpret_cast<size_t>( *( chain++ ) );
! for ( size_t i = 0; i < count; ++i )
{
if ( chain[i]->canHandleEvent( event ) )
Index: content.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/content.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** content.cpp 2 Nov 2004 20:45:46 -0000 1.1
--- content.cpp 3 Nov 2004 13:51:08 -0000 1.2
***************
*** 11,15 ****
ContainerCopyIterator::ContainerCopyIterator(const cItem *item) : pos(0) {
! content = ContainerContent(item->content());
}
--- 11,15 ----
ContainerCopyIterator::ContainerCopyIterator(const cItem *item) : pos(0) {
! content = item->content();
}
|