Fixed an off-by-two error in entityspawner

This commit is contained in:
Regalis
2017-03-07 23:02:33 +02:00
parent 6bae2cf47b
commit 64e866d771

View File

@@ -223,10 +223,10 @@ namespace Barotrauma
switch (message.ReadByte())
{
case (byte)SpawnableType.Item:
Item.ReadSpawnData(message, NetIdUtils.IdMoreRecent((UInt16)(ID - entityCount + i),(UInt16)(NetStateID+1)));
Item.ReadSpawnData(message, NetIdUtils.IdMoreRecent((UInt16)(ID - entityCount + i), (UInt16)(NetStateID - 1)));
break;
case (byte)SpawnableType.Character:
Character.ReadSpawnData(message, NetIdUtils.IdMoreRecent((UInt16)(ID - entityCount + i), (UInt16)(NetStateID + 1)));
Character.ReadSpawnData(message, NetIdUtils.IdMoreRecent((UInt16)(ID - entityCount + i), (UInt16)(NetStateID - 1)));
break;
default:
DebugConsole.ThrowError("Received invalid entity spawn message (unknown spawnable type)");