"Shifting" entity IDs to prevent them from overlapping between different subs, loading another submarine now works without crashing

This commit is contained in:
Regalis
2016-06-10 20:53:35 +03:00
parent 7349cdd310
commit ee2d817e6b
14 changed files with 83 additions and 44 deletions

View File

@@ -81,7 +81,7 @@ namespace Barotrauma
//give an unique ID
bool IDfound;
id = 1;//Rand.Int(int.MaxValue);
id = submarine == null ? (ushort)1 : submarine.IdOffset;
do
{
id += 1;