From da541a86764ca5922ff47b367561735efbcc2cf5 Mon Sep 17 00:00:00 2001
From: mcmlxxix <>
Date: Fri, 12 Dec 2014 15:50:47 +0000
Subject: [PATCH] create scores for users that dont yet have them when
 eliminating or being eliminated

---
 xtrn/dicewarz/maps.js | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/xtrn/dicewarz/maps.js b/xtrn/dicewarz/maps.js
index 70f4605e85..4d49e4fbc4 100644
--- a/xtrn/dicewarz/maps.js
+++ b/xtrn/dicewarz/maps.js
@@ -183,6 +183,14 @@ function 	Map(c,r,p,gn)
 		
 		if(killer.user>0) {
 			games.loadRankings();
+			if(!scores[killer.user]) {
+				scores[killer.user] = {
+					'score':0,
+					'kills':0,
+					'wins':0,
+					'losses':0
+				}
+			}
 			if(this.singlePlayer) 
 				scores[killer.user].score+=settings.killPointsSolo;
 			else 
@@ -195,6 +203,14 @@ function 	Map(c,r,p,gn)
 				games.loadRankings();
 				updaterankings=true;
 			}
+			if(!scores[dead.user]) {
+				scores[dead.user] = {
+					'score':0,
+					'kills':0,
+					'wins':0,
+					'losses':0
+				}
+			}
 			scores[dead.user].losses+=1;
 			if(this.singlePlayer) {
 				this.status=0;
@@ -355,7 +371,6 @@ function 	Map(c,r,p,gn)
 		var checked=[];
 		var counted=[];
 		var tocheck=[];
-		var y=10;
 		for(tttt in terr) {
 			var count=1;
 			tocheck.push(terr[tttt]);
-- 
GitLab