mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-27 03:35:20 +00:00
fix _patchedTypes having multiple of same type
This commit is contained in:
parent
9571b27ae0
commit
459929e4df
@ -84,10 +84,18 @@ namespace QSB.Patches
|
|||||||
|
|
||||||
TypeToInstance = new Dictionary<QSBPatchTypes, Harmony>
|
TypeToInstance = new Dictionary<QSBPatchTypes, Harmony>
|
||||||
{
|
{
|
||||||
{ QSBPatchTypes.OnClientConnect, new Harmony("QSB.Client") },
|
{
|
||||||
{ QSBPatchTypes.OnServerClientConnect, new Harmony("QSB.Server") },
|
QSBPatchTypes.OnClientConnect, new Harmony("QSB.Client")
|
||||||
{ QSBPatchTypes.OnNonServerClientConnect, new Harmony("QSB.NonServer") },
|
},
|
||||||
{ QSBPatchTypes.RespawnTime, new Harmony("QSB.Death") }
|
{
|
||||||
|
QSBPatchTypes.OnServerClientConnect, new Harmony("QSB.Server")
|
||||||
|
},
|
||||||
|
{
|
||||||
|
QSBPatchTypes.OnNonServerClientConnect, new Harmony("QSB.NonServer")
|
||||||
|
},
|
||||||
|
{
|
||||||
|
QSBPatchTypes.RespawnTime, new Harmony("QSB.Death")
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
DebugLog.DebugWrite("Patch Manager ready.", MessageType.Success);
|
DebugLog.DebugWrite("Patch Manager ready.", MessageType.Success);
|
||||||
@ -109,13 +117,13 @@ namespace QSB.Patches
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
patch.DoPatches(TypeToInstance[type]);
|
patch.DoPatches(TypeToInstance[type]);
|
||||||
_patchedTypes.Add(type);
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
DebugLog.ToConsole($"Error while patching {patch.GetType().Name} :\r\n{ex}", MessageType.Error);
|
DebugLog.ToConsole($"Error while patching {patch.GetType().Name} :\r\n{ex}", MessageType.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
_patchedTypes.Add(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void DoUnpatchType(QSBPatchTypes type)
|
public static void DoUnpatchType(QSBPatchTypes type)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user