Skip to content

Commit

Permalink
Fix double split issue on The Maw.
Browse files Browse the repository at this point in the history
  • Loading branch information
fatalis committed May 13, 2014
1 parent 481e504 commit 6233d4b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 7 additions & 3 deletions HaloSplitComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,15 @@ public string ComponentName
public IDictionary<string, Action> ContextMenuControls { get; protected set; }

private TimerModel _timer;
private LiveSplitState _state;
private GameMemory _gameMemory;
private DateTime? _splitTime;

public HaloSplitComponent(LiveSplitState state)
{
this.ContextMenuControls = new Dictionary<String, Action>();

_timer = new TimerModel();
_timer.CurrentState = state;
_state = state;

_gameMemory = new GameMemory();
// possible thread safety issues in all of these event handlers
Expand All @@ -43,7 +42,10 @@ public HaloSplitComponent(LiveSplitState state)
void gameMemory_OnMapChanged(object sender, string map)
{
if (map != @"levels\a10\a10")
{
_splitTime = DateTime.Now;
_timer.Split();
}
}

void gameMemory_OnReset(object sender, EventArgs e)
Expand All @@ -58,7 +60,9 @@ void gameMemory_OnGainControl(object sender, EventArgs e)

void gameMemory_OnLostControl(object sender, EventArgs eventArgs)
{
_timer.Split();
// hacky fix for double split issue on The Maw
if (_splitTime.HasValue && DateTime.Now - _splitTime.Value > TimeSpan.FromSeconds(10))
_timer.Split();
}

~HaloSplitComponent()
Expand Down
5 changes: 2 additions & 3 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
Expand Down Expand Up @@ -34,7 +33,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]

[assembly: ComponentFactory(typeof(HaloSplitFactory))]

0 comments on commit 6233d4b

Please sign in to comment.