mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
fixing a possible version not having commit hash attached to it case
This commit is contained in:
1 parent
2eb2567db9
commit
70320d7c19
2 files changed
+14
-5
No files matched your search
@@ -6,6 +6,7 @@ using Reactor;
|
||||
using Reactor.Patches;
|
||||
using System;
|
||||
using System.Text;
|
||||
using MiraAPI.Utilities;
|
||||
using Reactor.Networking;
|
||||
using Reactor.Networking.Attributes;
|
||||
using Reactor.Utilities;
|
||||
@@ -28,7 +29,7 @@ public partial class MiraApiPlugin : BasePlugin
|
||||
{
|
||||
Harmony.PatchAll();
|
||||
|
||||
ReactorCredits.Register("Mira API", Version[..15], true, ReactorCredits.AlwaysShow);
|
||||
ReactorCredits.Register("Mira API", Version.Truncate(15, "") ?? Version, true, ReactorCredits.AlwaysShow);
|
||||
|
||||
PluginManager = new MiraPluginManager();
|
||||
PluginManager.Initialize();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
#nullable enable
|
||||
using System.Collections.Generic;
|
||||
using MiraAPI.GameOptions;
|
||||
using System.Linq;
|
||||
using MiraAPI.Networking;
|
||||
@@ -9,6 +10,13 @@ namespace MiraAPI.Utilities;
|
||||
|
||||
public static class Extensions
|
||||
{
|
||||
public static string? Truncate(this string? value, int maxLength, string truncationSuffix = "…")
|
||||
{
|
||||
return value?.Length > maxLength
|
||||
? value.Substring(0, maxLength) + truncationSuffix
|
||||
: value;
|
||||
}
|
||||
|
||||
public static Queue<NetData[]> ChunkNetData(this IEnumerable<NetData> dataCollection, int chunkSize)
|
||||
{
|
||||
Queue<NetData[]> chunks = [];
|
||||
@@ -68,7 +76,7 @@ public static class Extensions
|
||||
return color.r < 0.5f && color.g < 0.5f && color.b < 0.5f;
|
||||
}
|
||||
|
||||
public static DeadBody NearestDeadBody(this PlayerControl playerControl, float radius)
|
||||
public static DeadBody? NearestDeadBody(this PlayerControl playerControl, float radius)
|
||||
{
|
||||
var results = new Il2CppSystem.Collections.Generic.List<Collider2D>();
|
||||
Physics2D.OverlapCircle(playerControl.GetTruePosition(), radius, Helpers.Filter, results);
|
||||
@@ -78,9 +86,9 @@ public static class Extensions
|
||||
.FirstOrDefault(component => component && !component.Reported);
|
||||
}
|
||||
|
||||
public static PlayerControl GetClosestPlayer(this PlayerControl playerControl, bool includeImpostors, float distance)
|
||||
public static PlayerControl? GetClosestPlayer(this PlayerControl playerControl, bool includeImpostors, float distance)
|
||||
{
|
||||
PlayerControl result = null;
|
||||
PlayerControl? result = null;
|
||||
if (!ShipStatus.Instance)
|
||||
{
|
||||
return null;
|
||||
|
||||
Reference in new issue
Block a user