Handle null gun in Minestrike

Steps to reproduce:
1) Bring a player down to low health using a molotov
2) Kill them with a grenade
This commit is contained in:
samczsun 2017-02-26 14:53:02 -05:00 committed by cnr
parent 9571db123d
commit 3f40432268

View File

@ -414,22 +414,29 @@ public class Minestrike extends TeamGame
int amount;
String gunType = (String) event.GetLog().GetLastDamager().GetDamage().getFirst().getMetadata().get("gunType");
switch (gunType)
if (gunType == null)
{
case "AWP":
amount = 100;
break;
case "PPBIZON":
amount = 600;
break;
case "NOVA":
amount = 900;
break;
case "KNIFE":
amount = 1500;
break;
default:
amount = 300;
amount = 300;
}
else
{
switch (gunType)
{
case "AWP":
amount = 100;
break;
case "PPBIZON":
amount = 600;
break;
case "NOVA":
amount = 900;
break;
case "KNIFE":
amount = 1500;
break;
default:
amount = 300;
}
}
_shopManager.addMoney(killer, amount, "kill with " + event.GetLog().GetLastDamager().GetReason());