mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
improved the "open door from the side" code to make the merc turn into the proper direction
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8633 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+2
-2
@@ -55,8 +55,8 @@
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CHAR8 czVersionNumber[16] = { "Build 18.30.10" }; //YY.MM.DD
|
CHAR8 czVersionNumber[16] = { "Build 18.31.10" }; //YY.MM.DD
|
||||||
CHAR16 zTrackingNumber[16] = { L"Z" };
|
CHAR16 zTrackingNumber[16] = { L"Z" };
|
||||||
CHAR16 zRevisionNumber[16] = { L"Revision 8632" };
|
CHAR16 zRevisionNumber[16] = { L"Revision 8633" };
|
||||||
|
|
||||||
// SAVE_GAME_VERSION is defined in header, change it there
|
// SAVE_GAME_VERSION is defined in header, change it there
|
||||||
|
|||||||
+41
-15
@@ -2198,27 +2198,53 @@ UINT32 UIHandleCMoveMerc( UI_EVENT *pUIEvent )
|
|||||||
{
|
{
|
||||||
// orientation NW - SE
|
// orientation NW - SE
|
||||||
case INSIDE_TOP_LEFT:
|
case INSIDE_TOP_LEFT:
|
||||||
if ( (sDestGridNo - pSoldier->sGridNo == 1) || (pSoldier->sGridNo - sDestGridNo == 1) ||
|
case OUTSIDE_TOP_LEFT:
|
||||||
( pStructure->fFlags & STRUCTURE_SLIDINGDOOR && sDestGridNo - pSoldier->sGridNo == 2) )
|
// standing south, left of door
|
||||||
|
if ( ( (sDestGridNo - pSoldier->sGridNo) == 1 || (pStructure->fFlags & STRUCTURE_SLIDINGDOOR && (sDestGridNo - pSoldier->sGridNo) == 2) )&& ubDirection == NORTH )
|
||||||
|
{
|
||||||
|
ubDirection = NORTHEAST;
|
||||||
bSideOpenDoor = true;
|
bSideOpenDoor = true;
|
||||||
|
} // standing south, right of door
|
||||||
|
else if ( (pSoldier->sGridNo - sDestGridNo) == 1 && ubDirection == NORTH )
|
||||||
|
{
|
||||||
|
ubDirection = NORTHWEST;
|
||||||
|
bSideOpenDoor = true;
|
||||||
|
} // standing north, left of door
|
||||||
|
else if ( (pSoldier->sGridNo - sDestGridNo) == 1 && ubDirection == SOUTH )
|
||||||
|
{
|
||||||
|
ubDirection = SOUTHWEST;
|
||||||
|
bSideOpenDoor = true;
|
||||||
|
} // standing north, right of door
|
||||||
|
else if ( ( (sDestGridNo - pSoldier->sGridNo) == 1 || (pStructure->fFlags & STRUCTURE_SLIDINGDOOR && (sDestGridNo - pSoldier->sGridNo) == 2) ) && ubDirection == SOUTH )
|
||||||
|
{
|
||||||
|
ubDirection = SOUTHEAST;
|
||||||
|
bSideOpenDoor = true;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
// orientation SW - NE
|
// orientation SW - NE
|
||||||
case INSIDE_TOP_RIGHT:
|
case INSIDE_TOP_RIGHT:
|
||||||
if ( (sDestGridNo - pSoldier->sGridNo == WORLD_COLS) || (pSoldier->sGridNo - sDestGridNo == WORLD_COLS) ||
|
|
||||||
( pStructure->fFlags & STRUCTURE_SLIDINGDOOR && sDestGridNo - pSoldier->sGridNo == WORLD_COLS *2) )
|
|
||||||
bSideOpenDoor = true;
|
|
||||||
break;
|
|
||||||
// orientation NW - SE
|
|
||||||
case OUTSIDE_TOP_LEFT:
|
|
||||||
if ( (sDestGridNo - pSoldier->sGridNo == 1) || (pSoldier->sGridNo - sDestGridNo == 1) ||
|
|
||||||
( pStructure->fFlags & STRUCTURE_SLIDINGDOOR && sDestGridNo - pSoldier->sGridNo == 2) )
|
|
||||||
bSideOpenDoor = true;
|
|
||||||
break;
|
|
||||||
// orientation SW - NE
|
|
||||||
case OUTSIDE_TOP_RIGHT:
|
case OUTSIDE_TOP_RIGHT:
|
||||||
if ( (sDestGridNo - pSoldier->sGridNo == WORLD_COLS) || (pSoldier->sGridNo - sDestGridNo == WORLD_COLS) ||
|
// standing east, left of door
|
||||||
( pStructure->fFlags & STRUCTURE_SLIDINGDOOR && sDestGridNo - pSoldier->sGridNo == WORLD_COLS *2) )
|
if ( (pSoldier->sGridNo - sDestGridNo) == WORLD_COLS && ubDirection == WEST )
|
||||||
|
{
|
||||||
|
ubDirection = NORTHWEST;
|
||||||
bSideOpenDoor = true;
|
bSideOpenDoor = true;
|
||||||
|
} // standing east, right of door
|
||||||
|
else if ( ( (sDestGridNo - pSoldier->sGridNo) == WORLD_COLS || (pStructure->fFlags & STRUCTURE_SLIDINGDOOR && (sDestGridNo - pSoldier->sGridNo) == (WORLD_COLS *2)) ) && ubDirection == WEST )
|
||||||
|
{
|
||||||
|
ubDirection = SOUTHWEST;
|
||||||
|
bSideOpenDoor = true;
|
||||||
|
} // standing west, left of door
|
||||||
|
else if ( ( (sDestGridNo - pSoldier->sGridNo) == WORLD_COLS || (pStructure->fFlags & STRUCTURE_SLIDINGDOOR && (sDestGridNo - pSoldier->sGridNo) == (WORLD_COLS *2)) ) && ubDirection == EAST )
|
||||||
|
{
|
||||||
|
ubDirection = SOUTHEAST;
|
||||||
|
bSideOpenDoor = true;
|
||||||
|
} // standing west, right of door
|
||||||
|
else if ( (pSoldier->sGridNo - sDestGridNo) == WORLD_COLS && ubDirection == EAST )
|
||||||
|
{
|
||||||
|
ubDirection = NORTHEAST;
|
||||||
|
bSideOpenDoor = true;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user