Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Commit

Permalink
Fixes #16
Browse files Browse the repository at this point in the history
  • Loading branch information
Jofairden committed Aug 4, 2017
1 parent b01fe2d commit 58d8fa1
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions TremorWorld.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,23 @@ private Boss FindBossMatch(string boss)

public static Dictionary<Boss, bool> downedBoss;

public override void Initialize()
private void Init()
{
downedBoss = new Dictionary<Boss, bool>();
foreach (Boss boss in Enum.GetValues(typeof(Boss)).Cast<Boss>())
if (downedBoss == null)
{
downedBoss[boss] = false;
downedBoss = new Dictionary<Boss, bool>();
foreach (Boss boss in Enum.GetValues(typeof(Boss)).Cast<Boss>())
{
downedBoss[boss] = false;
}
}
}

public override void Initialize()
{
Init();
}

public override TagCompound Save()
{
var downed = new List<string>();
Expand Down Expand Up @@ -132,9 +140,11 @@ public override void NetSend(BinaryWriter writer)
}
}


//NetReceive is called before Initialize when joining a server
public override void NetReceive(BinaryReader reader)
{
Init();

int bossCount = reader.ReadInt32();
int allocations = reader.ReadInt32();

Expand Down

0 comments on commit 58d8fa1

Please sign in to comment.