Fixed concurrent dictionary access.
This commit is contained in:
parent
bacb23b5ba
commit
5e50264194
2 changed files with 15 additions and 9 deletions
|
|
@ -2137,8 +2137,9 @@ namespace TShockAPI
|
|||
{
|
||||
args.Player.TilePlaceThreshold++;
|
||||
var coords = new Vector2(tileX, tileY);
|
||||
if (!args.Player.TilesCreated.ContainsKey(coords))
|
||||
args.Player.TilesCreated.Add(coords, Main.tile[tileX, tileY]);
|
||||
lock (args.Player.TilesCreated)
|
||||
if (!args.Player.TilesCreated.ContainsKey(coords))
|
||||
args.Player.TilesCreated.Add(coords, Main.tile[tileX, tileY]);
|
||||
}
|
||||
|
||||
if ((action == EditAction.KillTile || action == EditAction.KillTileNoItem || action == EditAction.KillWall) && Main.tileSolid[Main.tile[tileX, tileY].type] &&
|
||||
|
|
@ -2146,8 +2147,9 @@ namespace TShockAPI
|
|||
{
|
||||
args.Player.TileKillThreshold++;
|
||||
var coords = new Vector2(tileX, tileY);
|
||||
if (!args.Player.TilesDestroyed.ContainsKey(coords))
|
||||
args.Player.TilesDestroyed.Add(coords, Main.tile[tileX, tileY]);
|
||||
lock (args.Player.TilesDestroyed)
|
||||
if (!args.Player.TilesDestroyed.ContainsKey(coords))
|
||||
args.Player.TilesDestroyed.Add(coords, Main.tile[tileX, tileY]);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -2239,8 +2241,9 @@ namespace TShockAPI
|
|||
{
|
||||
args.Player.TilePlaceThreshold++;
|
||||
var coords = new Vector2(x, y);
|
||||
if (!args.Player.TilesCreated.ContainsKey(coords))
|
||||
args.Player.TilesCreated.Add(coords, Main.tile[x, y]);
|
||||
lock (args.Player.TilesCreated)
|
||||
if (!args.Player.TilesCreated.ContainsKey(coords))
|
||||
args.Player.TilesCreated.Add(coords, Main.tile[x, y]);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue