- cleaned up player reinitialization upon new game

This commit is contained in:
alexey.lysiuk 2018-12-21 13:11:33 +02:00
parent b64dfb54a5
commit 73d9751bb4

View file

@ -365,14 +365,14 @@ void G_NewInit ()
{ {
player_t *p = &players[i]; player_t *p = &players[i];
userinfo_t saved_ui; userinfo_t saved_ui;
saved_ui.TransferFrom(players[i].userinfo); saved_ui.TransferFrom(p->userinfo);
int chasecam = p->cheats & CF_CHASECAM; const int chasecam = p->cheats & CF_CHASECAM;
p->~player_t(); p->~player_t();
::new(p) player_t; ::new(p) player_t;
players[i].cheats |= chasecam; p->cheats |= chasecam;
players[i].playerstate = PST_DEAD; p->playerstate = PST_DEAD;
playeringame[i] = 0; p->userinfo.TransferFrom(saved_ui);
players[i].userinfo.TransferFrom(saved_ui); playeringame[i] = false;
} }
BackupSaveName = ""; BackupSaveName = "";
consoleplayer = 0; consoleplayer = 0;