Skip to content

Commit

Permalink
Painting same block over and over shouldn't add multiple blockdb entr…
Browse files Browse the repository at this point in the history
…ies.
  • Loading branch information
UnknownShadow200 committed Sep 9, 2017
1 parent 6f57fce commit d370674
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions fCraft/Player/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1252,14 +1252,16 @@ public bool PlaceBlock( Vector3I coord, ClickAction action, Block type ) {
RaisePlayerPlacedBlockEvent(this, World.Map, coordBelow, Block.Grass, Block.Dirt, context);
SendNow(Packet.MakeSetBlock(coordBelow, Block.Dirt));
}

// handle normal blocks
blockUpdate = new BlockUpdate(this, coord, type);
Info.ProcessBlockPlaced((byte)type);
Block old = map.GetBlock(coord);
map.QueueUpdate(blockUpdate);
RaisePlayerPlacedBlockEvent(this, World.Map, coord, old, type, context);
if (old != type) {
blockUpdate = new BlockUpdate(this, coord, type);
Info.ProcessBlockPlaced((byte)type);
map.QueueUpdate(blockUpdate);
RaisePlayerPlacedBlockEvent(this, World.Map, coord, old, type, context);
}
SendNow(Packet.MakeSetBlock(coord, type));

break;

case CanPlaceResult.BlocktypeDenied:
Expand Down

0 comments on commit d370674

Please sign in to comment.