Skip to content

[BUG]: FirearmWorldModel is null #365

@michcio15

Description

@michcio15

Before You Report

  • I have searched for existing reports of this bug, and this bug report is unique.

Version

1.1.5

Description

after dropping the weapon it loses its worldmodel

To Reproduce

    public override void OnPlayerShotWeapon(PlayerShotWeaponEventArgs ev)
    {
        base.OnPlayerShotWeapon(ev);
        Logger.Info($"{ev.FirearmItem.Serial} {ev.FirearmItem.Type}");

        if (!FirearmWorldmodel.Instances.TryGetValue(ev.FirearmItem.Serial, out var firearmWorldmodel))
        {
            Logger.Error("not have worldmoodel??");
            return;
        }

        if (!firearmWorldmodel.TryGetExtension(out BarrelTipExtension extension))
        {
            Logger.Error("not have barreltip??");
            return;
        }
    }

Expected Behavior

Dont throw null reference

Additional Information

[2026-02-18 18:34:09.002 +01:00] [INFO] [VeryFunnyNull] 484 GunAK
[2026-02-18 18:34:09.157 +01:00] [INFO] [VeryFunnyNull] 484 GunAK
[2026-02-18 18:34:09.642 +01:00] [INFO] [VeryFunnyNull] 484 GunAK
[2026-02-18 18:34:10.464 +01:00] [INFO] [VeryFunnyNull] 484 GunAK
[2026-02-18 18:34:11.024 +01:00] [INFO] [VeryFunnyNull] 484 GunAK
[2026-02-18 18:34:11.211 +01:00] [INFO] [VeryFunnyNull] 484 GunAK
[2026-02-18 18:34:20.619 +01:00] [INFO] [VeryFunnyNull] 484 GunAK
[2026-02-18 18:34:20.634 +01:00] [ERROR] [VeryFunnyNull] not have worldmoodel??
[2026-02-18 18:34:20.760 +01:00] [INFO] [VeryFunnyNull] 484 GunAK
[2026-02-18 18:34:20.775 +01:00] [ERROR] [VeryFunnyNull] not have worldmoodel??

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions