mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Driveable vehicle Update: Externalized vehicle seats (by anv)
- externalised vehicle seats (TableData\Vehicles.xml) influence position of passenger, field of view, ability to shoot and being hidden, - seat can chosen by using ctrl+RMB on vehicle (ctrl + LMB just takes the first visible seat) - seats can be changed or swapped while inside vehicle, - remade JSD files for cars, - vehicles aren't transparent anymore, - vehicles are louder than people, depending how fast they move. see: http://www.bears-pit.com/board/ubbthreads.php/topics/332790/5.html git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7212 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include "Quests.h"
|
||||
#include "items.h"
|
||||
#include "Item Types.h"
|
||||
#include "Vehicles.h"
|
||||
#endif
|
||||
#include "fresh_header.h"
|
||||
#include "WorldDat.h"
|
||||
@@ -902,6 +903,16 @@ INT16 GetSightAdjustment( SOLDIERTYPE* pSoldier, INT32 sGridNo, INT16 bLevel, IN
|
||||
iSightAdjustment += GetSightAdjustmentCamouflageOnTerrain( pSoldier, bStance, ubTerrainType );
|
||||
}
|
||||
|
||||
// anv: some places in vehicle completely obscure passenger from outside
|
||||
INT8 bSeatIndex = GetSeatIndexFromSoldier( pSoldier );
|
||||
if( bSeatIndex != (-1) )
|
||||
{
|
||||
if( gNewVehicle[ pVehicleList[ pSoldier->iVehicleId ].ubVehicleType ].VehicleSeats[ bSeatIndex ].fHidden )
|
||||
{
|
||||
iSightAdjustment = (-100);
|
||||
}
|
||||
}
|
||||
|
||||
return MINMAX100N(iSightAdjustment);
|
||||
}
|
||||
|
||||
@@ -2316,6 +2327,32 @@ INT32 SoldierToSoldierLineOfSightTest( SOLDIERTYPE * pStartSoldier, SOLDIERTYPE
|
||||
iTileSightLimit += iTileSightLimit * GetSightAdjustment(pEndSoldier) / 100;
|
||||
}
|
||||
|
||||
// anv: special check for vehicles - since they're no longer transparent, we need to check for visibility
|
||||
// of all substructures, also vehicle will be noticed even if just part of it is sticking around the corner
|
||||
if( pEndSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE && !TANK( pEndSoldier ) )
|
||||
{
|
||||
STRUCTURE *pBase = pEndSoldier->pLevelNode->pStructureData;
|
||||
if( pBase == NULL )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
DB_STRUCTURE_TILE ** ppTile = pBase->pDBStructureRef->ppTile;
|
||||
UINT8 ubNumberOfTiles = pBase->pDBStructureRef->pDBStructure->ubNumberOfTiles;
|
||||
|
||||
INT32 sStructGridNo;
|
||||
|
||||
// loop through all tiles
|
||||
for (UINT8 ubLoop = BASE_TILE; ubLoop < ubNumberOfTiles; ubLoop++)
|
||||
{
|
||||
sStructGridNo = AddPosRelToBase(pBase->sGridNo, ppTile[ubLoop]);
|
||||
if( LineOfSightTest( (FLOAT) CenterX( pStartSoldier->sGridNo ), (FLOAT) CenterY( pStartSoldier->sGridNo ), dStartZPos, (FLOAT) CenterX( sStructGridNo ), (FLOAT) CenterY( sStructGridNo ), dEndZPos, iTileSightLimit, bAware, fSmell, NULL, adjustForSight, cthCalc ) )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
return( LineOfSightTest( (FLOAT) CenterX( pStartSoldier->sGridNo ), (FLOAT) CenterY( pStartSoldier->sGridNo ), dStartZPos, (FLOAT) CenterX( pEndSoldier->sGridNo ), (FLOAT) CenterY( pEndSoldier->sGridNo ), dEndZPos, iTileSightLimit, bAware, fSmell, NULL, adjustForSight, cthCalc ) );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user