diff --git a/GameVersion.cpp b/GameVersion.cpp index 97b7fa95..c2c3bf59 100644 --- a/GameVersion.cpp +++ b/GameVersion.cpp @@ -23,7 +23,7 @@ INT16 zVersionLabel[256] = { L"Beta v. 0.98" }; #else //RELEASE BUILD VERSION - INT16 zVersionLabel[256] = { L"Release v1.13.194" }; + INT16 zVersionLabel[256] = { L"Release v1.13.202" }; #endif diff --git a/JA2.vcproj b/JA2.vcproj index 92316950..ac5721e1 100644 --- a/JA2.vcproj +++ b/JA2.vcproj @@ -43,7 +43,7 @@ bWisdom; + +// sTrueGridNo = pSoldier->sGridNo; +// pSoldier->sGridNo = sGridNo; + gsDesiredGridNo = sGridNo; + pSoldier->bWisdom = 8 * ubSearchRadius;// 5 tiles + + sResultGridNo = FindBestNearbyCover( pSoldier, MORALE_NORMAL, &iPercentBetter); + + pSoldier->bWisdom = bRealWisdom; +// pSoldier->sGridNo = sTrueGridNo; + + gsDesiredGridNo = NOWHERE; + + if( sResultGridNo != NOWHERE ) + return sResultGridNo; + else + return sGridNo; + +} + +INT8 FindDirectionForClimbing( INT16 sGridNo ) +{ + UINT16 usBuildingID; + UINT16 usClimbSpotIndex; + + for( usBuildingID = 0; usBuildingID < gubNumberOfBuildings ; ++usBuildingID ) + for( usClimbSpotIndex = 0; usClimbSpotIndex < gBuildings[ usBuildingID ].ubNumClimbSpots ; ++usClimbSpotIndex ) + if( gBuildings[ usBuildingID ].sUpClimbSpots[ usClimbSpotIndex ] == sGridNo ) + { + if( WhoIsThere2( gBuildings[ usBuildingID ].sDownClimbSpots[ usClimbSpotIndex ], 1 ) == NOBODY ) + return atan8(CenterX(sGridNo),CenterY(sGridNo),CenterX(gBuildings[ usBuildingID ].sDownClimbSpots[ usClimbSpotIndex ]),CenterY(gBuildings[ usBuildingID ].sDownClimbSpots[ usClimbSpotIndex ])); + }else if( gBuildings[ usBuildingID ].sDownClimbSpots[ usClimbSpotIndex ] == sGridNo ) + { + if( WhoIsThere2( gBuildings[ usBuildingID ].sUpClimbSpots[ usClimbSpotIndex ], 0 ) == NOBODY ) + return atan8(CenterX(sGridNo),CenterY(sGridNo),CenterX(gBuildings[ usBuildingID ].sUpClimbSpots[ usClimbSpotIndex ]),CenterY(gBuildings[ usBuildingID ].sUpClimbSpots[ usClimbSpotIndex ])); + } + return DIRECTION_IRRELEVANT; +} + +