Do not compute capture points for the invalid player on player defeat

Reviewed By: Freagarach
Refs #5745

Differential Revision: https://code.wildfiregames.com/D2748
This was SVN commit r23709.
This commit is contained in:
wraitii 2020-05-30 06:25:10 +00:00
parent 0363202a20
commit ed2ae1d283

View file

@ -362,7 +362,8 @@ Capturable.prototype.OnGlobalPlayerDefeated = function(msg)
if (!this.cp[msg.playerId])
return;
let cmpOwnership = Engine.QueryInterface(this.entity, IID_Ownership);
if (cmpOwnership && cmpOwnership.GetOwner() == msg.playerId)
if (cmpOwnership && (cmpOwnership.GetOwner() == INVALID_PLAYER ||
cmpOwnership.GetOwner() == msg.playerId))
return;
this.cp[0] += this.cp[msg.playerId];
this.cp[msg.playerId] = 0;