From a28f18cd15d8603fc4156d0e2260e12d0cb73fee Mon Sep 17 00:00:00 2001 From: Sevenfm Date: Mon, 26 Apr 2021 04:59:29 +0000 Subject: [PATCH] Fix for black windows (Orta) not blocking vision properly, code formatting (by Shadooow). git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8979 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- TileEngine/structure.cpp | 51 ++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/TileEngine/structure.cpp b/TileEngine/structure.cpp index 7ddedbb8..2e4377c7 100644 --- a/TileEngine/structure.cpp +++ b/TileEngine/structure.cpp @@ -2602,7 +2602,7 @@ INT8 GetBlockingStructureInfo( INT32 sGridNo, INT8 bDir, INT8 bNextDir, INT8 bLe // If no struct, return if ( pCurrent == NULL ) { - (*pStructHeight) = StructureHeight( pCurrent ); + (*pStructHeight) = StructureHeight( pCurrent ); (*ppTallestStructure) = NULL; return( NOTHING_BLOCKING ); } @@ -2642,40 +2642,45 @@ INT8 GetBlockingStructureInfo( INT32 sGridNo, INT8 bDir, INT8 bNextDir, INT8 bLe } // CHECK FOR WINDOW - if ( pCurrent->fFlags & STRUCTURE_WALLNWINDOW ) + if (pCurrent->fFlags & STRUCTURE_WALLNWINDOW) { + //shadooow: full blocking for black windows + if (pCurrent->fFlags & STRUCTURE_SPECIAL) + { + return(FULL_BLOCKING); + } switch( pCurrent->ubWallOrientation ) { case OUTSIDE_TOP_LEFT: case INSIDE_TOP_LEFT: - (*pStructHeight) = StructureHeight( pCurrent ); + (*pStructHeight) = StructureHeight( pCurrent ); (*ppTallestStructure) = pCurrent; - if ( pCurrent->fFlags & STRUCTURE_OPEN ) - { - return( BLOCKING_TOPLEFT_OPEN_WINDOW ); - } - else - { - return( BLOCKING_TOPLEFT_WINDOW ); - } + if ( pCurrent->fFlags & STRUCTURE_OPEN ) + { + return( BLOCKING_TOPLEFT_OPEN_WINDOW ); + } + else + { + return( BLOCKING_TOPLEFT_WINDOW ); + } break; case OUTSIDE_TOP_RIGHT: case INSIDE_TOP_RIGHT: - (*pStructHeight) = StructureHeight( pCurrent ); + (*pStructHeight) = StructureHeight( pCurrent ); (*ppTallestStructure) = pCurrent; - if ( pCurrent->fFlags & STRUCTURE_OPEN ) - { - return( BLOCKING_TOPRIGHT_OPEN_WINDOW ); - } - else - { - return( BLOCKING_TOPRIGHT_WINDOW ); - } + if ( pCurrent->fFlags & STRUCTURE_OPEN ) + { + return( BLOCKING_TOPRIGHT_OPEN_WINDOW ); + } + else + { + return( BLOCKING_TOPRIGHT_WINDOW ); + } break; } } @@ -2686,7 +2691,7 @@ INT8 GetBlockingStructureInfo( INT32 sGridNo, INT8 bDir, INT8 bNextDir, INT8 bLe // If we are not opem, we are full blocking! if ( !(pCurrent->fFlags & STRUCTURE_OPEN ) ) { - (*pStructHeight) = StructureHeight( pCurrent ); + (*pStructHeight) = StructureHeight( pCurrent ); (*ppTallestStructure) = pCurrent; return( FULL_BLOCKING ); break; @@ -2698,7 +2703,7 @@ INT8 GetBlockingStructureInfo( INT32 sGridNo, INT8 bDir, INT8 bNextDir, INT8 bLe case OUTSIDE_TOP_LEFT: case INSIDE_TOP_LEFT: - (*pStructHeight) = StructureHeight( pCurrent ); + (*pStructHeight) = StructureHeight( pCurrent ); (*ppTallestStructure) = pCurrent; return( BLOCKING_TOPLEFT_DOOR ); break; @@ -2706,7 +2711,7 @@ INT8 GetBlockingStructureInfo( INT32 sGridNo, INT8 bDir, INT8 bNextDir, INT8 bLe case OUTSIDE_TOP_RIGHT: case INSIDE_TOP_RIGHT: - (*pStructHeight) = StructureHeight( pCurrent ); + (*pStructHeight) = StructureHeight( pCurrent ); (*ppTallestStructure) = pCurrent; return( BLOCKING_TOPRIGHT_DOOR ); break;