Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gunplay massive lag / errors during fire #3

Open
docssy opened this issue May 6, 2020 · 4 comments
Open

gunplay massive lag / errors during fire #3

docssy opened this issue May 6, 2020 · 4 comments

Comments

@docssy
Copy link

docssy commented May 6, 2020

Getting countless log entries like this.

Exception ticking Spark195502 (at (226, 0, 138)): System.ArgumentNullException: Value cannot be null.
Parameter name: key
at System.Collections.Generic.Dictionary2[TKey,TValue].FindEntry (TKey key) [0x00008] in <567df3e0919241ba98db88bec4c6696f>:0 at System.Collections.Generic.Dictionary2[TKey,TValue].TryGetValue (TKey key, TValue& value) [0x00000] in <567df3e0919241ba98db88bec4c6696f>:0
at Verse.GenCollection.TryGetValue[T,V] (System.Collections.Generic.IDictionary`2[TKey,TValue] dict, T key, V fallback) [0x00000] in <36108d57f84d49cabdae818c2a53fc38>:0
at Gunplay.GunplaySetup.GunProp (Verse.ThingDef equipment) [0x00001] in <2f5b41d5bd4342c5aaaf0eb677720897>:0
at Gunplay.Patch.PatchProjectileImpact.Prefix (Verse.Projectile __instance, Verse.Thing hitThing, UnityEngine.Vector3 ___origin) [0x0001b] in <2f5b41d5bd4342c5aaaf0eb677720897>:0
at (wrapper dynamic-method) Verse.Projectile.DMD<DMD<Impact_Patch1>?1628900864::Impact_Patch1>(Verse.Projectile,Verse.Thing)
at RimWorld.Spark.Impact (Verse.Thing hitThing) [0x00007] in <36108d57f84d49cabdae818c2a53fc38>:0
at (wrapper dynamic-method) Verse.Projectile.DMD<DMD<ImpactSomething_Patch1>?-557604736::ImpactSomething_Patch1>(Verse.Projectile)
at Verse.Projectile.Tick () [0x000ed] in <36108d57f84d49cabdae818c2a53fc38>:0
at (wrapper dynamic-method) Verse.TickList.DMD<DMD<Tick_Patch2>?-368684160::Tick_Patch2>(Verse.TickList)
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)

Narrowed it down in your source files to this:

In Gunplay/Source/Patch/PatchProjectile.cs


    [HarmonyPatch(typeof(Projectile), "Impact")]
    class PatchProjectileImpact
    {
        static void Prefix(Projectile __instance, Thing hitThing, Vector3 ___origin)
        {
            Map map = __instance.Map;
            if (map == null) return;

            GunPropDef prop = GunplaySetup.GunProp(__instance.EquipmentDef);
            if (prop == null) return;

Basically something related to the fire is calling suppression, as the __instance projectile, but it is null. Maybe doesn't exist, or was just deleted?

@AUTOMATIC1111
Copy link
Owner

Are you sure you're not running one of earlier versions? This was a bug, and it just the same was happening with sparks from EMP explosions, but I did fix it in GunplaySetup.GunProp.

@docssy
Copy link
Author

docssy commented May 6, 2020

Dunno. Everything looks like its from March 25.

@AUTOMATIC1111
Copy link
Owner

Any way for me to reproduce this in-game?

@docssy
Copy link
Author

docssy commented May 7, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants