Fixed OnMapLoaded not being called on MapEntities that don't belong to any sub (due to this, gaps weren't created on doors in alien ruins until the game starts running, which occasionally caused entity ID mismatches between clients and the server)
This commit is contained in:
@@ -448,35 +448,7 @@ namespace Barotrauma
|
||||
renderer.SetWallVertices(CaveGenerator.GenerateWallShapes(cells));
|
||||
|
||||
renderer.PlaceSprites(generationParams.BackgroundSpriteAmount);
|
||||
|
||||
/*
|
||||
wrappingWalls = new WrappingWall[2, 2];
|
||||
|
||||
Rectangle ignoredArea = new Rectangle((int)startPosition.X, 0, (int)(endPosition.X - startPosition.X), borders.Height);
|
||||
|
||||
for (int side = 0; side < 2; side++)
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
wrappingWalls[side, i] = new WrappingWall(pathCells, cells, ignoredArea,
|
||||
(side == 0 ? -1 : 1) * (i + 1));
|
||||
|
||||
List<VertexPositionColor> wrappingWallVertices;
|
||||
CaveGenerator.GeneratePolygons(wrappingWalls[side, i].Cells, out wrappingWallVertices, false);
|
||||
|
||||
wrappingWalls[side, i].SetBodyVertices(wrappingWallVertices.ToArray());
|
||||
wrappingWalls[side, i].SetWallVertices(CaveGenerator.GenerateWallShapes(wrappingWalls[side, i].Cells));
|
||||
}
|
||||
|
||||
}
|
||||
for (int side = 0; side < 2; side++)
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
cells.AddRange(wrappingWalls[side, i].Cells);
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
ShaftBody = BodyFactory.CreateEdge(GameMain.World,
|
||||
ConvertUnits.ToSimUnits(new Vector2(borders.X, 0)),
|
||||
ConvertUnits.ToSimUnits(new Vector2(borders.Right, 0)));
|
||||
@@ -499,6 +471,9 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
//initialize MapEntities that aren't in any sub (e.g. items inside ruins)
|
||||
MapEntity.MapLoaded(null);
|
||||
|
||||
Debug.WriteLine("Generatelevel: " + sw2.ElapsedMilliseconds + " ms");
|
||||
sw2.Restart();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user