Some fixes to attachable items (buttons, signal items, etc):

- Syncing the attached/detached state of the items. This should fix the "received a position update for an item with no physics body " errors: midround-joining clients didn't get notified if an item had been detached, causing the error to appear every time it receives a position update.
- Detached items can be picked up just like any other item, instead of having to use a wrench and wait for the item to "detach".
- Wires can't be connected to items with a physics body (such as detached buttons).
This commit is contained in:
Joonas Rikkonen
2017-06-21 20:45:33 +03:00
parent db9a77fb25
commit de00eb2ab4
5 changed files with 111 additions and 42 deletions
@@ -90,6 +90,13 @@ namespace Barotrauma.Items.Components
public override bool Select(Character picker)
{
//attaching wires to items with a body is not allowed
//(signal items remove their bodies when attached to a wall)
if (item.body != null)
{
return false;
}
user = picker;
IsActive = true;
return true;