Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Commit

Permalink
Fixed ExtraLife bug
Browse files Browse the repository at this point in the history
  • Loading branch information
exel80 committed May 9, 2019
1 parent b2c6223 commit 5edf105
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions DropGoldAfterDeath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace DropGoldAfterDeath
{
[BepInDependency("com.bepis.r2api")]
[BepInPlugin("github.com/exel80/DropGoldAfterDeath", "DropGoldAfterDeath", "1.0.1")]
[BepInPlugin("github.com/exel80/DropGoldAfterDeath", "DropGoldAfterDeath", "1.0.2")]
public class DropGoldAfterDeath : BaseUnityPlugin
{
public void Awake()
Expand All @@ -26,15 +26,18 @@ public void Awake()
uint playerCount = Convert.ToUInt16(PlayerCharacterMasterController.instances.Count);
List<CharacterMaster> aliveLists = aliveList(component.master);
// Return if only 1 left or has extralife
if (aliveLists.Count < 1 || component.master.inventory.GetItemCount(ItemIndex.ExtraLife) <= 1)
// Return if there is no more alive player
if (aliveLists.Count < 1)
return;
// Return if player does have a extra life ~ @iDeathHD Thank you for bug report
if (component.master.inventory.GetItemCount(ItemIndex.ExtraLife) >= 1)
return;
// Take the money and split it
component.master.money = 0;
splitMoney(component.master, money, aliveLists);
// Broadcast drop message
// Broadcast drop message<
Chat.SendBroadcastChat(new Chat.SimpleChatMessage
{
baseToken = string.Format("<color=#e2b00b>{0} gold</color> has been dropped! " +
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "DropGoldAfterDeath",
"version_number": "1.0.1",
"version_number": "1.0.2",
"website_url": "https://github.com/exel80/DropGoldAfterDeath",
"description": "A Mod that drop player money after death and split them with alive player(s).",
"dependencies": [
Expand Down

0 comments on commit 5edf105

Please sign in to comment.