From c918f54d5642aaed59c6bd698b2e349c64a451f7 Mon Sep 17 00:00:00 2001 From: zicodxx Date: Fri, 14 Jan 2011 15:12:39 +0100 Subject: [PATCH] In multi_leave_game check for Player_eggs_Dropped before actually dropping to prevent multiple drops in case player quits game after being killed; put console output level of multiplayer powerup cap messagers to CON_VERBOSE; Fixed small compiler warning in gamesave.c due to last commit --- CHANGELOG.txt | 1 + main/gamesave.c | 1 + main/multi.c | 12 ++++++++---- main/object.h | 1 + 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2288e859b..5cfc3bd67 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ D1X-Rebirth Changelog -------- main/credits.c, main/menu.c, main/net_udp.c, main/scores.c: Fix compile errors introduced when merging main/collide.c, main/fireball.c, main/gamesave.c, main/gameseq.c, main/gameseq.h, main/laser.c, main/multi.c, main/multi.h, main/multibot.c, main/net_ipx.c, main/net_udp.c, main/object.c, main/powerup.c, main/powerup.h, main/weapon.c, main/weapon.h: Removed D1X implementation of multiplayer powerup capping and added D2X code to replace this (UDP-only); Added a bunch of D2X code for general and multiplayer powerup dropping to make codes more consistent to each other; Removed MULTI_PROTO_D1X_VER and MULTI_PROTO_D1X_MINOR defines since they are not needed anymore +main/gamesave.c, main/multi.c, main/object.h: In multi_leave_game check for Player_eggs_Dropped before actually dropping to prevent multiple drops in case player quits game after being killed; put console output level of multiplayer powerup cap messagers to CON_VERBOSE; Fixed small compiler warning in gamesave.c due to last commit 20110113 -------- diff --git a/main/gamesave.c b/main/gamesave.c index 95c2cc011..c12d56ae9 100644 --- a/main/gamesave.c +++ b/main/gamesave.c @@ -55,6 +55,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "gamefont.h" #include "gamesave.h" #include "textures.h" +#include "multi.h" #include "makesig.h" #ifndef NDEBUG diff --git a/main/multi.c b/main/multi.c index 88e991b58..e25f3396b 100644 --- a/main/multi.c +++ b/main/multi.c @@ -760,7 +760,11 @@ multi_leave_game(void) Net_create_loc = 0; multi_send_position(Players[Player_num].objnum); multi_powcap_cap_objects(); - drop_player_eggs(ConsoleObject); + if (!Player_eggs_dropped) + { + drop_player_eggs(ConsoleObject); + Player_eggs_dropped = 1; + } multi_send_player_explode(MULTI_PLAYER_DROP); } @@ -2272,8 +2276,8 @@ void multi_powcap_cap_objects() if (PowerupsInMine[(int)type]>=MaxPowerupsAllowed[(int)type]) if(Players[Player_num].primary_weapon_flags & (1 << index)) { - con_printf(CON_NORMAL,"PIM=%d MPA=%d\n",PowerupsInMine[(int)type],MaxPowerupsAllowed[(int)type]); - con_printf(CON_NORMAL,"Killing a primary cuz there's too many! (%d)\n",type); + con_printf(CON_VERBOSE,"PIM=%d MPA=%d\n",PowerupsInMine[(int)type],MaxPowerupsAllowed[(int)type]); + con_printf(CON_VERBOSE,"Killing a primary cuz there's too many! (%d)\n",type); Players[Player_num].primary_weapon_flags&=(~(1 << index)); } } @@ -2291,7 +2295,7 @@ void multi_powcap_cap_objects() Players[Player_num].secondary_ammo[index]=0; else Players[Player_num].secondary_ammo[index]=(MaxPowerupsAllowed[(int)type]-PowerupsInMine[(int)type]); - con_printf(CON_NORMAL,"Hey! I killed secondary type %d because PIM=%d MPA=%d\n",type,PowerupsInMine[(int)type],MaxPowerupsAllowed[(int)type]); + con_printf(CON_VERBOSE,"Hey! I killed secondary type %d because PIM=%d MPA=%d\n",type,PowerupsInMine[(int)type],MaxPowerupsAllowed[(int)type]); } } diff --git a/main/object.h b/main/object.h index 0c070d40f..efeace10b 100644 --- a/main/object.h +++ b/main/object.h @@ -356,6 +356,7 @@ extern object *Dead_player_camera; extern object Follow; extern int Player_is_dead; // !0 means player is dead! extern int Player_exploded; +extern int Player_eggs_dropped; extern int Death_sequence_aborted; extern int Player_fired_laser_this_frame;