fixed switching to hammer on kill

This commit is contained in:
caesarakalaeii 2023-08-13 01:19:22 +02:00
parent 75c5af0922
commit 425c9bb4ad
1 changed files with 13 additions and 10 deletions

View File

@ -47,17 +47,20 @@ public class MyPlayer : Player<MyPlayer>
public void UpdateWeapon() public void UpdateWeapon()
{ {
SetHeavyGadget("Sledge Hammer", 0); if (Level < gunGame.Count)
if (Level > gunGame.Count) return;
var w = new WeaponItem
{ {
ToolName = gunGame[Level].Name, var w = new WeaponItem
MainSight = Attachments.RedDot {
}; ToolName = gunGame[Level].Name,
SetPrimaryWeapon(w, 10, true); MainSight = Attachments.RedDot
};
SetPrimaryWeapon(w, 10, true);
}
SetHeavyGadget("Sledge Hammer", 0);
} }
public int getGameLenght() public int GetGameLenght()
{ {
return gunGame.Count; return gunGame.Count;
} }
@ -113,8 +116,8 @@ internal class MyGameServer : GameServer<MyPlayer>
var killer = onPlayerKillArguments.Killer; var killer = onPlayerKillArguments.Killer;
var victim = onPlayerKillArguments.Victim; var victim = onPlayerKillArguments.Victim;
killer.Level++; killer.Level++;
if (killer.Level == killer.getGameLenght()) AnnounceShort($"{killer.Name} only needs 1 more Kill"); if (killer.Level == killer.GetGameLenght()) AnnounceShort($"{killer.Name} only needs 1 more Kill");
if (killer.Level > killer.getGameLenght()) if (killer.Level > killer.GetGameLenght())
{ {
AnnounceShort($"{killer.Name} won the Game"); AnnounceShort($"{killer.Name} won the Game");
ForceEndGame(); ForceEndGame();