Changed entity ids from int to ushort, inventory sync bugfixes

This commit is contained in:
Regalis
2015-10-21 18:58:36 +03:00
parent 0233579e37
commit 313d16d886
20 changed files with 155 additions and 78 deletions

View File

@@ -7,15 +7,16 @@ namespace Barotrauma
{
class Entity
{
private static Dictionary<int, Entity> dictionary = new Dictionary<int, Entity>();
private static Dictionary<ushort, Entity> dictionary = new Dictionary<ushort, Entity>();
private int id;
private ushort id;
protected AITarget aiTarget;
//protected float soundRange;
//protected float sightRange;
public int ID
public ushort ID
{
get { return id; }
set
@@ -73,7 +74,7 @@ namespace Barotrauma
/// <summary>
/// Find an entity based on the ID
/// </summary>
public static Entity FindEntityByID(int ID)
public static Entity FindEntityByID(ushort ID)
{
Entity matchingEntity;
dictionary.TryGetValue(ID, out matchingEntity);