about summary refs log tree commit diff
path: root/src/game/server
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-17 22:36:03 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-17 22:36:03 +0000
commit511720b0e4493617dfdbe87f98802e594e61d8ea (patch)
treeb59bd21b0e0cfd4f78f535ada7fd2a9e695f4f86 /src/game/server
parent8cb74cfabe8392194a7e91d099ef3678c5fa61a9 (diff)
downloadzcatch-511720b0e4493617dfdbe87f98802e594e61d8ea.tar.gz
zcatch-511720b0e4493617dfdbe87f98802e594e61d8ea.zip
loads of minor fixes here and there. fixed invalid corrections and stuff like that
Diffstat (limited to 'src/game/server')
-rw-r--r--src/game/server/gs_server.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/game/server/gs_server.cpp b/src/game/server/gs_server.cpp
index 21b2f61f..70027086 100644
--- a/src/game/server/gs_server.cpp
+++ b/src/game/server/gs_server.cpp
@@ -855,7 +855,7 @@ void player::try_respawn()
 	weapons[WEAPON_GUN].ammo = data->weapons[WEAPON_GUN].maxammo;
 
 	weapons[WEAPON_RIFLE].got = true;
-	weapons[WEAPON_RIFLE].ammo = 100000; //data->weapons[WEAPON_LASER].maxammo;
+	weapons[WEAPON_RIFLE].ammo = -1;
 	
 	active_weapon = WEAPON_GUN;
 	last_weapon = WEAPON_HAMMER;
@@ -1101,7 +1101,8 @@ void player::fire_weapon()
 		
 	}
 
-	weapons[active_weapon].ammo--;
+	if(weapons[active_weapon].ammo > 0) // -1 == unlimited
+		weapons[active_weapon].ammo--;
 	attack_tick = server_tick();
 	reload_timer = data->weapons[active_weapon].firedelay * server_tickspeed() / 1000;
 }
@@ -1622,7 +1623,7 @@ void player::snap(int snaping_client)
 			info->local = 1;
 	}
 
-	if(health > 0 && team >= 0 && distance(players[snaping_client].pos, pos) < 1000.0f)
+	if(!dead && health > 0 && team >= 0 && distance(players[snaping_client].pos, pos) < 1000.0f)
 	{
 		NETOBJ_PLAYER_CHARACTER *character = (NETOBJ_PLAYER_CHARACTER *)snap_new_item(NETOBJTYPE_PLAYER_CHARACTER, client_id, sizeof(NETOBJ_PLAYER_CHARACTER));
 
@@ -1643,7 +1644,7 @@ void player::snap(int snaping_client)
 
 		character->emote = emote_type;
 
-		character->ammocount = weapons[active_weapon].ammo;
+		character->ammocount = 0;
 		character->health = 0;
 		character->armor = 0;
 		
@@ -1661,17 +1662,10 @@ void player::snap(int snaping_client)
 		{
 			character->health = health;
 			character->armor = armor;
+			if(weapons[active_weapon].ammo > 0)
+				character->ammocount = weapons[active_weapon].ammo;
 		}
 
-		if(dead)
-			character->health = -1;
-
-		//if(length(vel) > 15.0f)
-		//	player->emote = EMOTE_HAPPY;
-
-		//if(damage_taken_tick+50 > server_tick())
-		//	player->emote = EMOTE_PAIN;
-
 		if (character->emote == EMOTE_NORMAL)
 		{
 			if(250 - ((server_tick() - last_action)%(250)) < 5)