Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26899
Modified Files:
ChangeLog basedef.cpp basedef.h uobject.cpp
Log Message:
Fix annoying multi bugs.
Index: uobject.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/uobject.cpp,v
retrieving revision 1.187
retrieving revision 1.188
diff -C2 -d -r1.187 -r1.188
*** uobject.cpp 26 Sep 2004 14:41:22 -0000 1.187
--- uobject.cpp 1 Oct 2004 15:15:56 -0000 1.188
***************
*** 236,239 ****
--- 236,242 ----
serial_ = reader.readInt();
setMulti( dynamic_cast<cMulti*>( World::instance()->findItem( reader.readInt() ) ) );
+ if (multi_) {
+ multi_->addObject(this);
+ }
pos_.x = reader.readShort();
pos_.y = reader.readShort();
Index: basedef.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basedef.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** basedef.cpp 21 Sep 2004 05:28:04 -0000 1.22
--- basedef.cpp 1 Oct 2004 15:15:56 -0000 1.23
***************
*** 362,365 ****
--- 362,366 ----
{
id_ = id;
+ definitionType = WPDT_ITEM;
reset();
}
***************
*** 419,423 ****
inheritID = node->value();
! const cElement* element = Definitions::instance()->getDefinition( WPDT_ITEM, inheritID );
if ( element )
applyDefinition( element );
--- 420,424 ----
inheritID = node->value();
! const cElement* element = Definitions::instance()->getDefinition( definitionType, inheritID );
if ( element )
applyDefinition( element );
***************
*** 435,439 ****
{
loaded = true;
! const cElement* element = Definitions::instance()->getDefinition( WPDT_ITEM, id_ );
if ( !element )
--- 436,440 ----
{
loaded = true;
! const cElement* element = Definitions::instance()->getDefinition( definitionType, id_ );
if ( !element )
***************
*** 455,460 ****
if ( it == definitions.end() )
{
! cItemBaseDef* def = new cItemBaseDef( id );
! it = definitions.insert( id, def );
}
--- 456,467 ----
if ( it == definitions.end() )
{
! // Is this a multi base definition?
! if (Definitions::instance()->getDefinition(WPDT_MULTI, id)) {
! cMultiBaseDef* def = new cMultiBaseDef( id );
! it = definitions.insert( id, def );
! } else {
! cItemBaseDef* def = new cItemBaseDef( id );
! it = definitions.insert( id, def );
! }
}
***************
*** 682,683 ****
--- 689,694 ----
return cBaseDef::getProperty(name);
}
+
+ cMultiBaseDef::cMultiBaseDef(const QCString &id) : cItemBaseDef(id) {
+ definitionType = WPDT_MULTI;
+ }
Index: ChangeLog
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/ChangeLog,v
retrieving revision 1.87
retrieving revision 1.88
diff -C2 -d -r1.87 -r1.88
*** ChangeLog 30 Sep 2004 12:31:12 -0000 1.87
--- ChangeLog 1 Oct 2004 15:15:56 -0000 1.88
***************
*** 9,12 ****
--- 9,15 ----
- Fix bug # 0000341 ( set char.orgname on char creation )
- The bloodcolor for NPCs can now be defined.
+ - Containers and corpses ignore the object delay.
+ - Fixed base definitions for multis.
+ - Fixed items in multis being lost after two saves.
Wolfpack 12.9.11 Beta (26. September 2004)
Index: basedef.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basedef.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** basedef.h 21 Sep 2004 05:28:04 -0000 1.18
--- basedef.h 1 Oct 2004 15:15:56 -0000 1.19
***************
*** 29,32 ****
--- 29,33 ----
#define __BASEDEF_H__
+ #include "definitions.h"
#include "definable.h"
#include "singleton.h"
***************
*** 56,59 ****
--- 57,62 ----
virtual void load() = 0;
void refreshScripts();
+
+ eDefCategory definitionType;
public:
void processNode( const cElement* node );
***************
*** 359,362 ****
--- 362,371 ----
};
+ class cMultiBaseDef : public cItemBaseDef
+ {
+ public:
+ cMultiBaseDef( const QCString& id );
+ };
+
typedef SingletonHolder<cItemBaseDefs> ItemBaseDefs;
|