about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTeetime <TeetimeTW@yahoo.de>2011-11-18 17:26:14 +0100
committerTeetime <TeetimeTW@yahoo.de>2011-11-18 17:26:14 +0100
commit2b4b40504b6b21c98235d1c510220f53d5c0b556 (patch)
tree2d33717d1b9b8afb5da3babe31c17562e4968b80
parent2bda94f73eba7fd47790f9a18cc03249cb43adb3 (diff)
downloadzcatch-2b4b40504b6b21c98235d1c510220f53d5c0b556.tar.gz
zcatch-2b4b40504b6b21c98235d1c510220f53d5c0b556.zip
removed vanilla-mode and refractoring
-rw-r--r--src/game/server/entities/character.cpp32
-rw-r--r--src/game/server/gamecontroller.cpp2
-rw-r--r--src/game/server/gamemodes/zcatch.cpp4
-rw-r--r--src/game/variables.h2
4 files changed, 19 insertions, 21 deletions
diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp
index 4e91eb40..098bc255 100644
--- a/src/game/server/entities/character.cpp
+++ b/src/game/server/entities/character.cpp
@@ -138,7 +138,7 @@ void CCharacter::HandleNinja()
 		return;
 
 	/* zCatch */
-	if(GameServer()->m_pController->IsZCatch() == false || (GameServer()->m_pController->IsZCatch() && g_Config.m_SvMode == 0))
+	if(GameServer()->m_pController->IsZCatch() == false)
 	{
 		if ((Server()->Tick() - m_Ninja.m_ActivationTick) > (g_pData->m_Weapons.m_Ninja.m_Duration * Server()->TickSpeed() / 1000))
 		{
@@ -751,11 +751,11 @@ bool CCharacter::TakeDamage(vec2 Force, int Dmg, int From, int Weapon)
 	/* zCatch */
 	bool Is_zCatch = GameServer()->m_pController->IsZCatch();
 	
-	bool FromSelf = From == m_pPlayer->GetCID();
-	if(FromSelf)
+	if(From == m_pPlayer->GetCID())
 	{
-		if(Is_zCatch && g_Config.m_SvMode != 0 && g_Config.m_SvMode != 2)
-			Dmg = 0;	//No selfdamage, except in vanilla and all-weapons-mode
+		//No selfdamage
+		if(Is_zCatch)
+			Dmg = 0;
 		// m_pPlayer only inflicts half damage on self
 		else
 			Dmg = max(1, Dmg/2);
@@ -775,17 +775,19 @@ bool CCharacter::TakeDamage(vec2 Force, int Dmg, int From, int Weapon)
 		m_DamageTaken = 0;
 		GameServer()->CreateDamageInd(m_Pos, 0, Dmg);
 	}
-	/* zCatch*/
-	//One-Shot-One-Kill
-	if(Is_zCatch && (g_Config.m_SvMode != 0 && g_Config.m_SvMode != 2 && !FromSelf)) // all except vanilla-mode and all weapons
-	{
-		m_Health = 0;
-		m_Armor = 0;
-	}
-	/* end zCatch*/
-	else if(Dmg)
+
+	if(Dmg)
 	{
-		if(m_Armor)
+		/* zCatch*/
+		//One-Shot-One-Kill
+		if(Is_zCatch)
+		{
+			m_Health = 0;
+			m_Armor = 0;
+		}
+		/* end zCatch*/
+
+		else if(m_Armor)
 		{
 			if(Dmg > 1)
 			{
diff --git a/src/game/server/gamecontroller.cpp b/src/game/server/gamecontroller.cpp
index eb9dc9b5..5f330110 100644
--- a/src/game/server/gamecontroller.cpp
+++ b/src/game/server/gamecontroller.cpp
@@ -137,7 +137,7 @@ bool IGameController::OnEntity(int Index, vec2 Pos)
 	else if(Index == ENTITY_SPAWN_BLUE)
 		m_aaSpawnPoints[2][m_aNumSpawnPoints[2]++] = Pos;
 	/* zCatch */
-   	else if(!GameServer()->m_pController->IsZCatch() || g_Config.m_SvMode == 0)
+   	else if(!GameServer()->m_pController->IsZCatch())
     	{
         if(Index == ENTITY_ARMOR_1)
             Type = POWERUP_ARMOR;
diff --git a/src/game/server/gamemodes/zcatch.cpp b/src/game/server/gamemodes/zcatch.cpp
index 328faeee..2f373e84 100644
--- a/src/game/server/gamemodes/zcatch.cpp
+++ b/src/game/server/gamemodes/zcatch.cpp
@@ -167,10 +167,6 @@ void CGameController_zCatch::OnCharacterSpawn(class CCharacter *pChr)
 	// give default weapons
 	switch(g_Config.m_SvMode)
 		{
-			case 0:
-				pChr->GiveWeapon(WEAPON_HAMMER, -1);
-				pChr->GiveWeapon(WEAPON_GUN, 10);
-				break;
 			case 1:
 				pChr->GiveWeapon(WEAPON_RIFLE, -1);
 				break;
diff --git a/src/game/variables.h b/src/game/variables.h
index 2f037d75..324a1901 100644
--- a/src/game/variables.h
+++ b/src/game/variables.h
@@ -90,7 +90,7 @@ MACRO_CONFIG_INT(DbgFocus, dbg_focus, 0, 0, 1, CFGFLAG_CLIENT, "")
 MACRO_CONFIG_INT(DbgTuning, dbg_tuning, 0, 0, 1, CFGFLAG_CLIENT, "")
 
 //zCatch:
-MACRO_CONFIG_INT(SvMode, sv_mode, 1, 0, 5, CFGFLAG_SERVER, "0 - Normal; 1 - Instagib; 2 - Rocket area; 3 - Hammerparty; 4 - Grenade; 5 - Ninja")
+MACRO_CONFIG_INT(SvMode, sv_mode, 1, 1, 5, CFGFLAG_SERVER, "1 - Instagib; 2 - Rocket area; 3 - Hammerparty; 4 - Grenade; 5 - Ninja")
 MACRO_CONFIG_INT(SvAllowJoin, sv_allow_join, 2, 1, 2, CFGFLAG_SERVER, "Allow new Players to join without waiting for the next round")
 //1 = Allowed to join; 2 = Will join when person with the most kills die
 MACRO_CONFIG_INT(SvColorIndicator, sv_color_indicator, 1, 0, 1, CFGFLAG_SERVER, "Color tees apropriate to the number of currently catched players")