diff -durN 58/docs/rh-log.txt 59/docs/rh-log.txt
--- 58/docs/rh-log.txt	Sat Dec 06 18:44:28 2003
+++ 59/docs/rh-log.txt	Sat Dec 06 22:44:54 2003
@@ -1,4 +1,7 @@
 December 5, 2003
+- Rewrote P_TranslateTeleportThings() so that it only assigns TIDs to things
+  in sectors with tag 0.
+- Fixed: Teleporters by TID didn't work.
 - Fixed: P_SpawnMissileXYZ spawned floor/ceiling huggers as if they could move
   with a vertical component to their velocity. They can't, so it could result
   in very slow moving projectiles when aiming at something nearby in the X/Y
diff -durN 58/src/p_teleport.cpp 59/src/p_teleport.cpp
--- 58/src/p_teleport.cpp	Fri Dec 05 23:28:12 2003
+++ 59/src/p_teleport.cpp	Sat Dec 06 22:13:58 2003
@@ -313,6 +313,7 @@
 				}
 			}
 		}
+		return searcher;
 	}
 
 	if (tag != 0)
diff -durN 58/src/p_xlat.cpp 59/src/p_xlat.cpp
--- 58/src/p_xlat.cpp	Fri Dec 05 23:02:04 2003
+++ 59/src/p_xlat.cpp	Sat Dec 06 22:41:14 2003
@@ -331,84 +331,45 @@
 	memset (ld->args, 0, sizeof(ld->args));
 }
 
-// The teleport specials that use things as destinations also require
-// that their TIDs be set to the tags of their containing sectors. We
-// do that after the rest of the level has been loaded. If any dest is
-// in a sector with a tag of 0, it gets mapped to some unused tag and
-// so do the lines that reference it.
+// Now that ZDoom again gives the option of using Doom's original teleport
+// behavior, only teleport dests in a sector with a 0 tag need to be
+// given a TID. And since Doom format maps don't have TIDs, we can safely
+// give them TID 1.
 
 void P_TranslateTeleportThings ()
 {
-	TArray<ATeleportDest *> baddests;
-	TArray<int> badlines;
-	int i, j;
-	int highestid = 0;
+	ATeleportDest *dest;
+	TThinkerIterator<ATeleportDest> iterator;
+	bool foundSomething = false;
 
-	for (i = 0; i < numlines; i++)
+	while ( (dest = iterator.Next()) )
 	{
-		if (lines[i].special == Teleport ||
-			lines[i].special == Teleport_NoFog)
+		if (dest->Sector->tag == 0)
 		{
-			if (lines[i].args[0] == 0)
-			{
-				badlines.Push (i);
-			}
-			else if (lines[i].args[0] > highestid)
+			dest->tid = 1;
+			dest->AddToHash ();
+			foundSomething = true;
+		}
+	}
+
+	if (foundSomething)
+	{
+		for (int i = 0; i < numlines; ++i)
+		{
+			if (lines[i].special == Teleport)
 			{
-				highestid = lines[i].args[0];
+				if (lines[i].args[1] == 0)
+				{
+					lines[i].args[1] = 1;
+				}
 			}
-
-			// The sector tag hash table hasn't been set up yet,
-			// so we need to use this linear search.
-			for (j = 0; j < numsectors; j++)
+			else if (lines[i].special == Teleport_NoFog)
 			{
-				if (sectors[j].tag == lines[i].args[0])
+				if (lines[i].args[2] == 0)
 				{
-					ATeleportDest *other;
-					TThinkerIterator<ATeleportDest> iterator;
-
-					while ( (other = iterator.Next ()) )
-					{
-						// wrong sector
-						if (other->Sector - sectors != j)
-							continue;
-
-						// already handled
-						if (other->tid != 0)
-							continue;
-
-						// it's a teleportdest
-						if (lines[i].args[0] == 0)
-						{
-							baddests.Push (other);
-							other->tid = 1;
-						}
-						else
-						{
-							other->tid = lines[i].args[0];
-							other->AddToHash ();
-						}
-					}
-					if (other)
-						break;
+					lines[i].args[2] = 1;
 				}
 			}
-		}
-	}
-
-	if (baddests.Size ())
-	{
-		ATeleportDest *other;
-
-		highestid++;
-		while (baddests.Pop (other))
-		{
-			other->tid = highestid;
-			other->AddToHash ();
-		}
-		while (badlines.Pop (i))
-		{
-			lines[i].args[0] = highestid;
 		}
 	}
 }
diff -durN 58/src/version.h 59/src/version.h
--- 58/src/version.h	Sat Dec 06 18:44:30 2003
+++ 59/src/version.h	Sat Dec 06 22:17:14 2003
@@ -37,7 +37,7 @@
 // Lots of different representations for the version number
 enum { VERSION = 204 };
 #define STRVERSION "204"
-#define DOTVERSIONSTR "2.0.58"
+#define DOTVERSIONSTR "2.0.59"
 #define GAMEVER (2*256+2)
 
 // SAVEVER is the version of the information stored in level snapshots.
diff -durN 58/src/win32/zdoom.rc 59/src/win32/zdoom.rc
--- 58/src/win32/zdoom.rc	Sat Dec 06 18:44:30 2003
+++ 59/src/win32/zdoom.rc	Sat Dec 06 22:17:14 2003
@@ -134,7 +134,7 @@
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 2,0,58,0
+ FILEVERSION 2,0,59,0
  PRODUCTVERSION 2,0,0,0
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
@@ -153,7 +153,7 @@
             VALUE "Comments", "Thanks to id Software for creating DOOM and then releasing the source code. Thanks also to TeamTNT for creating BOOM, which ZDoom is partially based on. Includes code based on the Cajun Bot 0.97 by Martin Collberg."
             VALUE "CompanyName", " "
             VALUE "FileDescription", "ZDoom"
-            VALUE "FileVersion", "2.0.58"
+            VALUE "FileVersion", "2.0.59"
             VALUE "InternalName", "ZDoom"
             VALUE "LegalCopyright", "Copyright © 1993-1996, id Software & 1998-2003, Randy Heit"
             VALUE "LegalTrademarks", "Doom® is a Registered Trademark of id Software, Inc."
