Skip to content

Commit

Permalink
Fixed auto-equiping weapon and player advancing on knife kill.
Browse files Browse the repository at this point in the history
  • Loading branch information
SomeCatIDK committed Jul 19, 2017
1 parent 1557c4c commit de7cfea
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
25 changes: 14 additions & 11 deletions GunGame/GunGamePlayerComponent.cs
Expand Up @@ -44,7 +44,7 @@ public void EnterGame()

public void KickPlayer()
{
Invoke ("Kick", 5);
Invoke ("Kick", 3);
}

void Kick()
Expand All @@ -59,6 +59,7 @@ public void DeathCallback(bool wasByKnife)
if (wasByKnife && currentWeapon != 0) {
currentWeapon--;
}
data.deaths++;
deaths++;
}

Expand All @@ -75,17 +76,19 @@ void TeleportAfterRespawn()
Player.Teleport (GameManager.GetSpawnPositionRR (), 0);
}

public void KillCallback()
public void KillCallback(bool wasWithKnife)
{
if (currentWeapon == GunGameConfig.instance.weapons.weapons.Length - 1) {
currentWeapon++;
GameManager.RequestFinish ();
} else {
ClearInv ();
currentWeapon++;
GiveKit (currentWeapon);
if (wasWithKnife) {
if (currentWeapon == GunGameConfig.instance.weapons.weapons.Length - 1) {
currentWeapon++;
GameManager.RequestFinish ();
} else {
ClearInv ();
currentWeapon++;
GiveKit (currentWeapon);
}
}

data.kills++;
kills++;
}

Expand All @@ -110,7 +113,7 @@ void GiveKit(byte kit)
Player.Inventory.items [2].tryAddItem (mag);
Player.Inventory.items [2].tryAddItem (mag);

Player.Player.equipment.tellAskEquip (Player.CSteamID, 0, 0, 0);
Player.Player.equipment.tryEquip (0, 0, 0);
}
}
}
Expand Down
5 changes: 1 addition & 4 deletions GunGame/Managers/EventManager.cs
Expand Up @@ -51,11 +51,8 @@ static void OnPlayerDeath(UnturnedPlayer player, EDeathCause cause, ELimb limb,

GunGame.Say ("kill", Color.magenta, m.DisplayName, itemName, player.DisplayName);

player.GunGamePlayer ().data.deaths++;
m.GunGamePlayer ().data.kills++;

player.GunGamePlayer ().DeathCallback (cause == EDeathCause.MELEE || cause == EDeathCause.PUNCH);
m.GunGamePlayer ().KillCallback ();
m.GunGamePlayer ().KillCallback (cause == EDeathCause.MELEE || cause == EDeathCause.PUNCH);

}
}
Expand Down
2 changes: 1 addition & 1 deletion Properties/AssemblyInfo.cs
Expand Up @@ -6,4 +6,4 @@
[assembly: AssemblyProduct ("GunGame")]
[assembly: AssemblyCopyright ("(c) 52 Piece Games 2017")]

[assembly: AssemblyVersion ("1.1.0")]
[assembly: AssemblyVersion ("1.1.1")]

0 comments on commit de7cfea

Please sign in to comment.