Index: /code/branches/release2012/src/orxonox/gametypes/LastTeamStanding.cc
===================================================================
--- /code/branches/release2012/src/orxonox/gametypes/LastTeamStanding.cc	(revision 9362)
+++ /code/branches/release2012/src/orxonox/gametypes/LastTeamStanding.cc	(revision 9363)
@@ -242,15 +242,8 @@
                     party = it2->second;
                 }
-                //if (party < 0) return; //if search failed
+                if (party < 0) return; //if search failed
                 //victory message to all team members, loose message to everyone else
-                for (std::map<PlayerInfo*, int>::iterator it3 = this->teamnumbers_.begin(); it3 != this->teamnumbers_.end(); ++it3)
-                {
-                  if (it3->first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
-                        continue;
-                    if (it3->second == party)
-                        {this->gtinfo_->sendAnnounceMessage("You have won the match!", it3->first->getClientID());}
-                    else
-                        {this->gtinfo_->sendAnnounceMessage("You have lost the match!", it3->first->getClientID());}
-                }
+                this->announceTeamWin(party);
+
                 return;
             }
Index: /code/branches/release2012/src/orxonox/gametypes/TeamDeathmatch.cc
===================================================================
--- /code/branches/release2012/src/orxonox/gametypes/TeamDeathmatch.cc	(revision 9362)
+++ /code/branches/release2012/src/orxonox/gametypes/TeamDeathmatch.cc	(revision 9363)
@@ -33,4 +33,5 @@
 #include "infos/PlayerInfo.h"
 #include "worldentities/pawns/Pawn.h"
+#include "core/ConfigValueIncludes.h"
 
 namespace orxonox
@@ -41,4 +42,11 @@
     {
         RegisterObject(TeamDeathmatch);
+
+        this->setConfigValues();
+    }
+
+    void TeamDeathmatch::setConfigValues()
+    {
+        SetConfigValue(maxScore_, 10);
     }
 
@@ -57,4 +65,19 @@
         std::string message("The match has ended.");
         ChatManager::message(message);
+        
+        //find team that won the match
+        int winnerTeam = 0;
+        int highestScore = 0;
+        for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+        {
+            if ( this->getTeamScore(it->first) > highestScore )
+            {
+                winnerTeam = this->getTeam(it->first);
+                highestScore = this->getTeamScore(it->first);
+            }
+        }
+
+        //announce win
+        this->announceTeamWin(winnerTeam);
     }
 
@@ -100,5 +123,9 @@
             {
                 if (killer->getPlayer())
+                {
                     message = victim->getPlayer()->getName() + " was killed by " + killer->getPlayer()->getName();
+                    if(this->isExactlyA(Class(TeamDeathmatch)) && (this->getTeamScore(killer->getPlayer()) >= (this->maxScore_ -1)) )
+                        this->end();
+                }
                 else
                     message = victim->getPlayer()->getName() + " was killed";
@@ -109,5 +136,4 @@
             ChatManager::message(message);
         }
-
         Gametype::pawnKilled(victim, killer);
     }
@@ -121,4 +147,5 @@
             const std::string& message = player->getName() + " scores!";
             ChatManager::message(message);
+
         }
     }
Index: /code/branches/release2012/src/orxonox/gametypes/TeamDeathmatch.h
===================================================================
--- /code/branches/release2012/src/orxonox/gametypes/TeamDeathmatch.h	(revision 9362)
+++ /code/branches/release2012/src/orxonox/gametypes/TeamDeathmatch.h	(revision 9363)
@@ -41,4 +41,5 @@
             virtual ~TeamDeathmatch() {}
 
+            void setConfigValues();
             virtual void start();
             virtual void end();
@@ -49,4 +50,6 @@
             virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
             virtual void playerScored(PlayerInfo* player, int score = 1);
+       protected:
+            int maxScore_; 
     };
 }
Index: /code/branches/release2012/src/orxonox/gametypes/TeamGametype.cc
===================================================================
--- /code/branches/release2012/src/orxonox/gametypes/TeamGametype.cc	(revision 9362)
+++ /code/branches/release2012/src/orxonox/gametypes/TeamGametype.cc	(revision 9363)
@@ -173,4 +173,19 @@
     }
 
+    int TeamGametype::getTeamScore(PlayerInfo* player)
+    {
+        int teamscore = 0;
+        if(!player || this->getTeam(player) == -1)
+            return 0;
+        for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
+        {
+            if ( this->getTeam(it->first) ==  this->getTeam(player) )
+            {
+                teamscore += it->second.frags_;
+            }
+        }
+        return teamscore;
+    }
+
     SpawnPoint* TeamGametype::getBestSpawnPoint(PlayerInfo* player) const
     {
@@ -336,3 +351,20 @@
     }
 
+    void TeamGametype::announceTeamWin(int winnerTeam)
+    {
+        for (std::map<PlayerInfo*, int>::iterator it3 = this->teamnumbers_.begin(); it3 != this->teamnumbers_.end(); ++it3)
+        {
+            if (it3->first->getClientID() == NETWORK_PEER_ID_UNKNOWN)
+                continue;
+            if (it3->second == winnerTeam)
+            {
+                this->gtinfo_->sendAnnounceMessage("Your team has won the match!", it3->first->getClientID());
+            }
+            else
+            {
+                this->gtinfo_->sendAnnounceMessage("Your team has lost the match!", it3->first->getClientID());
+            }
+        }   
+    }
+
 }
Index: /code/branches/release2012/src/orxonox/gametypes/TeamGametype.h
===================================================================
--- /code/branches/release2012/src/orxonox/gametypes/TeamGametype.h	(revision 9362)
+++ /code/branches/release2012/src/orxonox/gametypes/TeamGametype.h	(revision 9363)
@@ -62,4 +62,6 @@
             inline const ColourValue& getTeamColour(int teamnr) const
                 { return this->teamcolours_[teamnr]; }
+            int getTeamScore(PlayerInfo* player);
+
 
         protected:
@@ -77,4 +79,6 @@
             void setDefaultObjectColour(Pawn* pawn);
             void colourPawn(Pawn* pawn, int teamNr);
+            void announceTeamWin(int winnerTeam);
+
     };
 }
