qwbarch / mirage

A mod that mimics player voices for Unity games
https://thunderstore.io/c/lethal-company/p/qwbarch/Mirage
Other
12 stars 2 forks source link

Masked Enemies That Spawn On Player Death Not Working #46

Closed TheDebbyCase closed 5 months ago

TheDebbyCase commented 6 months ago

Upon a player dying and a Masked being spawned the following error occurs:

[Error  : Unity Log] KeyNotFoundException: The given key '0' was not present in the dictionary.
Stack trace:
System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <787acc3c9a4c471ba7d971300105af24>:IL_001E)
MoreCompany.MimicPatches+MaskedPlayerEnemyOnEnablePatch.Postfix (MaskedPlayerEnemy __instance) (at D:/VisualStudioProjects/MoreCompany/MoreCompany/MimicPatches.cs:20)
(wrapper dynamic-method) MaskedPlayerEnemy.DMD<MaskedPlayerEnemy::SetEnemyOutside>(MaskedPlayerEnemy,bool)
Mirage.Unity.MimicPlayer+MimicPlayer.mimicPlayer (GameNetcodeStuff.PlayerControllerB player, MaskedPlayerEnemy maskedEnemy) (at <bb3c5abfbf0f761d45d71245a75f47f8>:IL_0032)
Mirage.Unity.MimicPlayer+MimicPlayer.MimicPlayer (System.Int32 playerId) (at <bb3c5abfbf0f761d45d71245a75f47f8>:IL_0083)
Mirage.Unity.MimicPlayer+StartMimicking@93-1.Invoke (GameNetcodeStuff.PlayerControllerB _arg3) (at <bb3c5abfbf0f761d45d71245a75f47f8>:IL_000A)
Mirage.Unity.MimicPlayer+StartMimicking@86.Invoke (EnemyAI _arg2) (at <bb3c5abfbf0f761d45d71245a75f47f8>:IL_0094)
Mirage.Unity.MimicPlayer+MimicPlayer.StartMimicking () (at <bb3c5abfbf0f761d45d71245a75f47f8>:IL_0047)
Mirage.Patch.SpawnMaskedEnemy+start mimicking player@95.Invoke (Mirage.Unity.MimicPlayer+MimicPlayer _arg3) (at <bb3c5abfbf0f761d45d71245a75f47f8>:IL_0002)
FSharpPlus.Control.Bind.op_GreaterGreaterEquals[T,E,U] (Microsoft.FSharp.Core.FSharpResult`2[T,TError] source, Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] k) (at <e68e201c5389fd652badc99bd11d87ee>:IL_0000)
Mirage.Patch.SpawnMaskedEnemy+SpawnMaskedEnemy.start mimicking player (MaskedPlayerEnemy __instance) (at <bb3c5abfbf0f761d45d71245a75f47f8>:IL_0050)
(wrapper dynamic-method) MaskedPlayerEnemy.DMD<MaskedPlayerEnemy::Start>(MaskedPlayerEnemy)

This is followed by a spam of the errors below:

[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
EnemyAI.SetClientCalculatingAI (System.Boolean enable) (at <af9b1eec498a45aebd42601d6ab85015>:IL_0007)
(wrapper dynamic-method) EnemyAI.DMD<EnemyAI::Update>(EnemyAI)
(wrapper dynamic-method) MaskedPlayerEnemy.DMD<MaskedPlayerEnemy::Update>(MaskedPlayerEnemy)

[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
MaskedPlayerEnemy.LookAtFocusedPosition () (at <af9b1eec498a45aebd42601d6ab85015>:IL_0185)
MaskedPlayerEnemy.LateUpdate () (at <af9b1eec498a45aebd42601d6ab85015>:IL_0017)

Ingame the Masked does not move or attack. Upon leaving the moon, the Masked and an arbitrary number of other enemies are also broken and fail to despawn. This can cause the enemies to appear on subsequent moons, though they have no AI.

This occurred on Experimentation, a vanilla moon, and regardless of where the player died.

qwbarch commented 5 months ago

Leaving this here in case I forget. List of mods shared in two modpacks that has this issue:

AinaVT-LethalConfig 1.3.4 (Shared)
Alice-ScarletDevilMansion 1.3.6 (Ciryond), 1.3.7 (Lunxara)
AllToasters-SpectateEnemies 2.3.1 (Shared)
BepInEx-BepInExPack 5.4.2100 (Shared)
Bobbie-NAudio 2.2.2 (Shared)
Bobbie-UniTask 2.5.0 (Shared)
Ccode_lang-SirenHead 1.2.1 (Ciryond), 1.2.3 (Lunxara)
EliteMasterEric-Coroner 1.6.2 (Shared)
EliteMasterEric-WackyCosmetics 2.0.0 (Shared)
Evaisa-HookGenPatcher 0.0.5 (Shared)
Evaisa-LethalLib 0.14.3 (Ciryond), 0.14.4 (Lunxara)
Evaisa-LethalThings 0.9.4 (Shared)
FlipMods-FasterItemDropship 1.2.1 (Shared)
FlipMods-ReservedFlashlightSlot 2.0.1 (Ciryond), 2.0.2 (Lunxara)
FlipMods-ReservedItemSlotCore 2.0.7 (Ciryond), 2.0.12 (Lunxara)
FlipMods-ReservedWalkieSlot 2.0.1 (Ciryond), 2.0.2 (Lunxara)
FutureSavior-Hold_Scan_Button 1.1.1 (Shared)
Hardy-LCMaxSoundsFix 1.1.0 (Shared)
Hexnet-SuitSaver 1.1.4 (Shared) 
IAmBatby-LethalLevelLoader 1.1.6 (Shared)
IntegrityChaos-Diversity 2.0.3 (Shared)
IntegrityChaos-GraphicsAPI 1.0.0 (Shared)
IntegrityChaos-LCCutscene 1.0.0 (Shared)
LethalResonance-LETHALRESONANCE 4.2.3 (Shared)
Lordfirespeed-OdinSerializer 2022.11.9 (Shared)
Monkeytype-HideChat 1.0.0 (Shared)
NiceHairs-NuclearLib 1.0.4 (Shared)
Refract-LethalLevelLoaderFixed 1.1.0 (Shared)
Rune-LethalCompany_InputUtils 0.7.1 (Shared)
Suskitech-AlwaysHearActiveWalkies 1.4.4 (Shared)
fumiko-CullFactory 0.9.2 (Shared)
jaspercreations-Scopophobia 1.1.1 (Shared)
loaforc-loaforcsSoundAPI 0.1.3 (Shared)
malco-Lategame_Upgrades 3.3.1 (Ciryond), 3.4.1 (Lunxara)
notnotnotswipez-MoreCompany 1.8.1 (Shared)
qwbarch-BarchLib 1.0.0 (Shared)
qwbarch-Mirage 1.1.0 (Ciryond), 1.1.1 (Lunxara)
sunnobunno-YippeeMod 1.2.4 (Shared)
x-More_Suits 1.4.1 (Shared)
xilophor-LethalNetworkAPI 2.1.6 (Shared)
zealsprince-Locker 1.1.0 (Shared)
qwbarch commented 5 months ago

Seems like the issue was caused by MattysFixes and is a no longer causing a conflict. If there are any other reports with this error, I'll open this issue back up