Skip to content

Commit

Permalink
fix: don't update kill statistics if player died of own account (#242)
Browse files Browse the repository at this point in the history
Co-authored-by: Josephine Rueckert <jd.rueckert@googlemail.com>
  • Loading branch information
ujjman and jdrueckert committed Dec 2, 2021
1 parent ce6132c commit 9c30f58
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ public void beforeDestroy(BeforeDestroyEvent event, EntityRef player,
if (player.hasComponent(PlayerCharacterComponent.class)) {
event.consume();
String team = player.getComponent(LASTeamComponent.class).team;
updateStatistics(event.getInstigator(), "kills");
// if a player dies on their own account, we don't want to update kill statistics
if (event.getInstigator() != EntityRef.NULL) {
updateStatistics(event.getInstigator(), "kills");
}
updateStatistics(player, "deaths");
dropItemsFromInventory(player);
player.send(new RestoreFullHealthEvent(player));
Expand Down

0 comments on commit 9c30f58

Please sign in to comment.