Skip to content

Commit

Permalink
Fix for round duration bug where it was always ~16 seconds if you pul…
Browse files Browse the repository at this point in the history
…led the lever to leave.
  • Loading branch information
danielmccluskey committed Jan 20, 2024
1 parent a5ea913 commit 8c08e9e
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,4 @@ FodyWeavers.xsd
# JetBrains Rider
*.sln.iml
Packaged/Danos-LethalStats-v0.9.0.zip
Packaged/Danos-LethalStats-v0.9.1.zip
28 changes: 24 additions & 4 deletions LethalStatsMod/Patches/StartMatchLeverPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using UnityEngine;
using Coroner;
using LethalStats.Models;
using System.Collections;

namespace LethalStats.Patches
{
Expand All @@ -18,19 +19,38 @@ public static class PullLeverAnimPatch
public static string DebugPrefix = "[LethalStats] [PullLeverAnimPatch]: ";
static void Postfix()
{

try
{
DanosPlayerStats.ResetValues();
UpdateHostInfo();
UpdateLevelName();
UpdateRoundStartTime();
StartOfRound startOfRound = StartOfRound.Instance;
if (startOfRound == null) return;

//If inshipphase, reset the values otherwise don't do anything
if (startOfRound.inShipPhase)
{
Debug.Log(DebugPrefix + "In ship phase, reset the values");
DanosPlayerStats.ResetValues();
UpdateHostInfo();
UpdateLevelName();
UpdateRoundStartTime();
}
else
{
Debug.Log(DebugPrefix + "Not in ship phase, do nothing");
}

}
catch (Exception ex)
{
Debug.Log($"{DebugPrefix}Error in Postfix: {ex.Message}");
}
}






private static void UpdateHostInfo()
{
try
Expand Down
6 changes: 5 additions & 1 deletion Packaged/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
#### v 0.9.1
- Fix for round duration bug always being roughly 16 seconds.

#### v.0.9.0
- Initial Release for testing.
- Initial Release for testing.

Binary file modified Packaged/LethalStats.dll
Binary file not shown.
3 changes: 3 additions & 0 deletions Packaged/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ A Mod for the game Lethal Company that collects and displays your stats at https

You can see an example by visiting my profile page (Most of my match history will be me instantly jumping off the ship to test the mod settings :D) https://lethal.splitstats.io/r/danielmclovin69

#### Stats as of 20/01/2024
Over 300 users and 4000 matches recorded so far!


## Pre-Release Notice
Just as a quick note, this mod is not at V1.0 yet, it is still in the testing and development stage.
Expand Down
2 changes: 1 addition & 1 deletion Packaged/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "LethalStats",
"version_number": "0.9.0",
"version_number": "0.9.1",
"website_url": "https://lethal.splitstats.io",
"description": "A Mod for the game Lethal Company that collects and displays your stats at https://lethal.splitstats.io",
"dependencies": [
Expand Down

0 comments on commit 8c08e9e

Please sign in to comment.