1. Ok now i gonna creazy...

    If i switch the weapons in my belt and zoom with the scope i get the console error in rust: More than one viewmodel active at the same time. After this message i cant zoom anymore and a pice of my player stands on the old position?!
    WTF?

    I creat the weapon with:

    Code:
            private Item makeItem(string shortname, int amount, bool zoom, int id)
            {
                var definition = ItemManager.FindItemDefinition(shortname);
                if (definition != null)
                {
                    Item item = ItemManager.CreateByItemID((int)definition.itemid, amount);
                    if (id == 0)
                    {
                    }
                    else
                    {
                        item.skin = id;
                    }
                    if (zoom == true)
                    {
                        item.contents.AddItem(makeItem("weapon.mod.small.scope", 1, false, 0).info, 1);
                    }
                    return item;
                }
                return null;
            }        [ChatCommand("test")]
            void test(BasePlayer player, string command)
            {
                player.inventory.containerBelt.itemList.Clear();
                player.inventory.GiveItem(makeItem("rifle.bolt", 1, true, 0), player.inventory.containerBelt);
            }
    Whats wrong. Is it a rust bug?
    [DOUBLEPOST=1472581375][/DOUBLEPOST]Update: if i use the chat command test, this error comes. it create every i typ test a new viewmodel from me. but why?
     

    Attached Files:

    • wtf.png
      wtf.png
      File size:
      4.1 MB
      Views:
      86
    Last edited by a moderator: Aug 30, 2016
  2. Update 2:
    I createt a new plugin only with this test command. And the error is the same:
    Output rust console and exceptions:
     

    Attached Files:

    • wtf2.png
      wtf2.png
      File size:
      522.9 KB
      Views:
      65
  3. Update 3:
    Now i made some tests. it occurs only when you remove the aktiv scope in your hand via player.inventory.containerBelt.itemList.Clear(); so how to clear the item in the players hand?
     
  4. fixed it. works now