mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-20 06:58:20 +00:00
fixed crashbug caused by players disconnecting while still having bullets in the air
This commit is contained in:
parent
557636dca3
commit
55254d0657
|
@ -345,6 +345,9 @@ bool GAMECONTROLLER::is_friendly_fire(int cid1, int cid2)
|
||||||
|
|
||||||
if(is_teamplay())
|
if(is_teamplay())
|
||||||
{
|
{
|
||||||
|
if(!game.players[cid1] || !game.players[cid2])
|
||||||
|
return false;
|
||||||
|
|
||||||
if(game.players[cid1]->team == game.players[cid2]->team)
|
if(game.players[cid1]->team == game.players[cid2]->team)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -505,6 +508,10 @@ void GAMECONTROLLER::snap(int snapping_client)
|
||||||
|
|
||||||
int GAMECONTROLLER::get_auto_team(int notthisid)
|
int GAMECONTROLLER::get_auto_team(int notthisid)
|
||||||
{
|
{
|
||||||
|
// this will force the auto balancer to work overtime aswell
|
||||||
|
if(config.dbg_stress)
|
||||||
|
return 0;
|
||||||
|
|
||||||
int numplayers[2] = {0,0};
|
int numplayers[2] = {0,0};
|
||||||
for(int i = 0; i < MAX_CLIENTS; i++)
|
for(int i = 0; i < MAX_CLIENTS; i++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue