Skip to content

Commit

Permalink
Fixed another possible bug in the new door code
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonty800 committed Nov 11, 2012
1 parent 0600f95 commit 68baedb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions fCraft/Doors/DoorHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ public static DoorHandler GetInstance () {

//cuboid over-fix?
public static void PlayerPlacedDoor ( object sender, Events.PlayerPlacingBlockEventArgs e ) {
if ( e.Player.World.Map.Doors == null ) return;
if ( e.Player.World != null ) {
if ( e.Player.World.Map != null ) {
if ( e.Map.Doors == null ) return;
if ( e.Map.World != null ) {
if ( e.Map != null ) {
if ( e.Context != BlockChangeContext.Manual ) {
if ( e.Player.World.Map.Doors.Count > 0 ) {
lock ( e.Player.World.Map.Doors.SyncRoot ) {
foreach ( Door door in e.Player.WorldMap.Doors ) {
if ( e.Map.Doors.Count > 0 ) {
lock ( e.Map.Doors.SyncRoot ) {
foreach ( Door door in e.Map.Doors ) {
if ( e.Map == null ) break;
if ( door.IsInRange( e.Coords ) ) {
e.Result = CanPlaceResult.Revert;
}
Expand Down

0 comments on commit 68baedb

Please sign in to comment.