Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15956
Modified Files:
ChangeLog definitions.cpp definitions.h server.cpp
territories.cpp territories.h
Log Message:
teleporter fixes
added color for static tiles
Index: territories.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/territories.cpp,v
retrieving revision 1.55
retrieving revision 1.56
diff -C2 -d -r1.55 -r1.56
*** territories.cpp 25 Sep 2004 02:03:20 -0000 1.55
--- territories.cpp 1 Oct 2004 19:43:56 -0000 1.56
***************
*** 313,317 ****
// Make sure that there is one top level region for each map
// Insert it at the beginning (last overrides first).
! for ( unsigned char i = 0; i <= 3; ++i )
{
if ( Maps::instance()->hasMap( i ) )
--- 313,317 ----
// Make sure that there is one top level region for each map
// Insert it at the beginning (last overrides first).
! for ( unsigned char i = 0; i <= 4; ++i )
{
if ( Maps::instance()->hasMap( i ) )
***************
*** 356,359 ****
--- 356,399 ----
}
+ // Get the toplevel teleporters and insert them
+ const QValueVector<cElement*> &teleporters = Definitions::instance()->getDefinitions(WPDT_TELEPORTER);
+ QValueVector<cElement*>::const_iterator tit;
+ for (tit = teleporters.begin(); tit != teleporters.end(); ++tit) {
+ cElement *element = *tit;
+
+ // Source + Destination
+ QString source = element->getAttribute("source");
+ QString destination = element->getAttribute("destination");
+
+ if (source.isEmpty() || destination.isEmpty()) {
+ continue; // Skip broken teleporters
+ }
+
+ // Convert into coordinates
+ Coord_cl clSource, clDestination;
+ if (!parseCoordinates(source, clSource) || !parseCoordinates(destination, clDestination)) {
+ continue; // Skip broken coordinates
+ }
+
+ // Search the region for the source spot
+ cTerritory *rSource = region(clSource);
+ if (rSource) {
+ rSource->addTeleporter(clSource, clDestination); // Add the teleportation spot
+ } else {
+ Console::instance()->log(LOG_WARNING, tr("Couldn't find source region for teleporter at %1.").arg(source));
+ }
+
+ // Add another teleportation spot at the destination coordinate if this is a two-way teleporter
+ QString bothways = element->getAttribute("bothways", "false");
+ if (bothways == "true" || bothways == "1" || bothways == "on") {
+ cTerritory *rDestination = region(clDestination);
+ if (rDestination) {
+ rDestination->addTeleporter(clDestination, clSource); // Add the teleportation spot
+ } else {
+ Console::instance()->log(LOG_WARNING, tr("Couldn't find destination region for two-way teleporter at %1.").arg(destination));
+ }
+ }
+ }
+
cComponent::load();
}
Index: territories.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/territories.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** territories.h 24 Sep 2004 04:47:38 -0000 1.31
--- territories.h 1 Oct 2004 19:43:56 -0000 1.32
***************
*** 248,251 ****
--- 248,258 ----
public:
std::map<UI32, good_st> tradesystem_;
+
+ inline void addTeleporter(const Coord_cl &from, const Coord_cl &to) {
+ teleporters_st t;
+ t.source = from;
+ t.destination = to;
+ teleporters.append(t);
+ }
};
Index: server.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/server.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** server.cpp 25 Sep 2004 22:57:09 -0000 1.29
--- server.cpp 1 Oct 2004 19:43:56 -0000 1.30
***************
*** 214,217 ****
--- 214,222 ----
//registerComponent(PythonEngine::instance(), "python", false, true, "configuration");
+ registerComponent( Maps::instance(), QT_TR_NOOP("maps"), true, false, "configuration" );
+ registerComponent( SectorMaps::instance(), QT_TR_NOOP("sectormaps"), false, true, "maps" );
+ registerComponent( TileCache::instance(), QT_TR_NOOP("tiledata"), true, false, "configuration" );
+ registerComponent( MultiCache::instance(), QT_TR_NOOP("multis"), true, false, "configuration" );
+
registerComponent( Definitions::instance(), QT_TR_NOOP("definitions"), true, false, "configuration" );
registerComponent( ScriptManager::instance(), QT_TR_NOOP("scripts"), true, false, "definitions" );
***************
*** 220,228 ****
registerComponent( Territories::instance(), QT_TR_NOOP("territories"), true, false, "definitions" );
- registerComponent( Maps::instance(), QT_TR_NOOP("maps"), true, false, "configuration" );
- registerComponent( SectorMaps::instance(), QT_TR_NOOP("sectormaps"), false, true, "maps" );
- registerComponent( TileCache::instance(), QT_TR_NOOP("tiledata"), true, false, "configuration" );
- registerComponent( MultiCache::instance(), QT_TR_NOOP("multis"), true, false, "configuration" );
-
// Accounts come before world
registerComponent( Accounts::instance(), QT_TR_NOOP("accounts"), true, false );
--- 225,228 ----
Index: ChangeLog
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/ChangeLog,v
retrieving revision 1.89
retrieving revision 1.90
diff -C2 -d -r1.89 -r1.90
*** ChangeLog 1 Oct 2004 16:32:52 -0000 1.89
--- ChangeLog 1 Oct 2004 19:43:56 -0000 1.90
***************
*** 16,19 ****
--- 16,21 ----
- Fixed bug #0000335. (Riding liches + toads)
- Fixed bug #0000340. (Showing unicode properties crashes the server)
+ - Allowed global teleporter tags.
+ - Static tile color can now be retrieved via wolfpack.statics()
Wolfpack 12.9.11 Beta (26. September 2004)
Index: definitions.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/definitions.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** definitions.cpp 25 Sep 2004 02:03:19 -0000 1.19
--- definitions.cpp 1 Oct 2004 19:43:56 -0000 1.20
***************
*** 89,92 ****
--- 89,93 ----
{ "contextmenu", WPDT_CONTEXTMENU },
{ "ai", WPDT_AI },
+ { "teleporter", WPDT_TELEPORTER },
{ 0, WPDT_COUNT },
};
Index: definitions.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/definitions.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** definitions.h 2 Jun 2004 15:04:04 -0000 1.4
--- definitions.h 1 Oct 2004 19:43:56 -0000 1.5
***************
*** 70,73 ****
--- 70,74 ----
WPDT_CONTEXTMENU,
WPDT_AI,
+ WPDT_TELEPORTER,
WPDT_COUNT
};
|