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 01:58:11 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-17 01:58:11 +0000
commit57204ecd9dbe6dd8ada4cc2be1cc63150e99f5c5 (patch)
tree37804c5dc9bf9dce26aa7adaf44582459a16f0f6 /src/game/server
parent29e616919e6aa107da2c4c81cea0b84201c5dd98 (diff)
downloadzcatch-57204ecd9dbe6dd8ada4cc2be1cc63150e99f5c5.tar.gz
zcatch-57204ecd9dbe6dd8ada4cc2be1cc63150e99f5c5.zip
fixed the no ammo sound on the ninja
Diffstat (limited to 'src/game/server')
-rw-r--r--src/game/server/gs_server.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/game/server/gs_server.cpp b/src/game/server/gs_server.cpp
index b415fabd..724ef36f 100644
--- a/src/game/server/gs_server.cpp
+++ b/src/game/server/gs_server.cpp
@@ -978,7 +978,7 @@ int player::handle_ninja()
 
 void player::fire_weapon()
 {
-	if(reload_timer != 0)
+	if(reload_timer != 0 || active_weapon == WEAPON_NINJA)
 		return;
 	
 	vec2 direction = normalize(vec2(latest_input.target_x, latest_input.target_y));
@@ -990,14 +990,13 @@ void player::fire_weapon()
 	//if(count_input(latest_previnput.fire, latest_input.fire).presses) || ((fullauto && latest_input.fire&1) && weapons[active_weapon].ammo))
 	if(!count_input(latest_previnput.fire, latest_input.fire).presses)
 		return;
-	
+		
 	// check for ammo
 	if(!weapons[active_weapon].ammo)
 	{
 		create_sound(pos, SOUND_WEAPON_NOAMMO);
 		return;
 	}
-
 	
 	switch(active_weapon)
 	{
@@ -1351,7 +1350,8 @@ void player::on_direct_input(NETOBJ_PLAYER_INPUT *new_input)
 {
 	mem_copy(&latest_previnput, &latest_input, sizeof(latest_input));
 	mem_copy(&latest_input, new_input, sizeof(latest_input));
-	fire_weapon();
+	if(team != -1 && !dead)
+		fire_weapon();
 }
 
 void player::tick()