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

This commit is contained in:
zicodxx 2011-01-14 15:13:29 +01:00
parent eeecf4016e
commit c8f4140bd6
3 changed files with 10 additions and 4 deletions

View file

@ -4,6 +4,7 @@ D2X-Rebirth Changelog
--------
arch/include/event.h, arch/include/key.h, arch/include/mouse.h, arch/sdl/event.c, arch/sdl/key.c, arch/sdl/mouse.c, editor/med.c, include/ui.h, main/automap.c, main/credits.c, main/escort.c, main/gamecntl.c, main/inferno.c, main/inferno.h, main/kconfig.c, main/kmatrix.c, main/menu.c, main/movie.c, main/net_ipx.c, main/net_udp.c, main/newmenu.c, main/scores.c, main/titles.c, ui/file.c, ui/keypress.c, ui/menu.c, ui/menubar.c, ui/message.c, ui/mouse.c, ui/popup.c, ui/window.c: For editor, replace use of ui_mega_process() with event_process(), with the editor's own default event handler; add EVENT_MOUSE_MOVED event with event_mouse_get_delta() accessor; add event_key_get() to replace ugly casting; rename mouse_get_button() with event_mouse_get_button() to keep with name convention; only send idle events when there are no input events so editor still works properly (or the same anyway); add and use event_send() function for input events (including idle)
main/fireball.c, main/gamesave.c, main/multi.c, main/multi.h, main/net_ipx.c, main/net_udp.c, main/object.c, main/object.h: Fixing code used for capping powerups in multiplayer - it was not correctly conting 4pack powerups; Cleaned up this code a bit and added more consistent naming convention for functions to maybe make it more understandable; Removed MULTI_PROTO_D2X_VER define as it's not needed
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
20110111
--------

View file

@ -926,7 +926,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);
}
@ -2571,8 +2575,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));
}
}
@ -2597,7 +2601,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]);
}
}

View file

@ -380,6 +380,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;