mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
Strip clothes: drop item to soldier's level if no place in inventory.
HandleTalkInit: - use SoldierToSoldierLineOfSightTest to check sight to person - increased talking range for militia to TACTICAL_RANGE When checking if radio set equipped for using with militia command feature, don't check for AP_RADIO as the game will deduct AP_TALK when giving order. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8942 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -6506,7 +6506,8 @@ BOOLEAN HandleTalkInit( )
|
|||||||
if ( !(( pTSoldier->bTeam == MILITIA_TEAM ) && ( CheckIfRadioIsEquipped() )) ) //lal
|
if ( !(( pTSoldier->bTeam == MILITIA_TEAM ) && ( CheckIfRadioIsEquipped() )) ) //lal
|
||||||
{
|
{
|
||||||
// Check LOS!
|
// Check LOS!
|
||||||
if ( !SoldierTo3DLocationLineOfSightTest( pSoldier, pTSoldier->sGridNo, pTSoldier->pathing.bLevel, 3, TRUE, CALC_FROM_ALL_DIRS ) )
|
//if ( !SoldierTo3DLocationLineOfSightTest( pSoldier, pTSoldier->sGridNo, pTSoldier->pathing.bLevel, 3, TRUE, CALC_FROM_ALL_DIRS ) )
|
||||||
|
if (!SoldierToSoldierLineOfSightTest(pSoldier, pTSoldier, TRUE, CALC_FROM_ALL_DIRS))
|
||||||
{
|
{
|
||||||
if ( pTSoldier->ubProfile != NO_PROFILE )
|
if ( pTSoldier->ubProfile != NO_PROFILE )
|
||||||
{
|
{
|
||||||
@@ -6620,14 +6621,9 @@ BOOLEAN HandleTalkInit( )
|
|||||||
|
|
||||||
//lal
|
//lal
|
||||||
if ( pTSoldier->bTeam == MILITIA_TEAM )
|
if ( pTSoldier->bTeam == MILITIA_TEAM )
|
||||||
{
|
commandRange = TACTICAL_RANGE;
|
||||||
commandRange = NPC_TALK_RADIUS*3;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
commandRange = NPC_TALK_RADIUS;
|
commandRange = NPC_TALK_RADIUS;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if ( ( uiRange > commandRange ) && ( !CheckIfRadioIsEquipped() ) ) //lal
|
if ( ( uiRange > commandRange ) && ( !CheckIfRadioIsEquipped() ) ) //lal
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1110,21 +1110,16 @@ BOOLEAN CheckIfRadioIsEquipped( void )
|
|||||||
SOLDIERTYPE *pSoldier = NULL;
|
SOLDIERTYPE *pSoldier = NULL;
|
||||||
INT8 bSlot = NO_SLOT;
|
INT8 bSlot = NO_SLOT;
|
||||||
|
|
||||||
// do we have a radio ?
|
|
||||||
//pSoldier = GetSelectedAssignSoldier( FALSE ); //do not use
|
|
||||||
|
|
||||||
if ( GetSoldier( &pSoldier, gusSelectedSoldier ) )
|
if ( GetSoldier( &pSoldier, gusSelectedSoldier ) )
|
||||||
{
|
{
|
||||||
// Flugente: active radio sets also count as radio
|
// Flugente: active radio sets also count as radio
|
||||||
if ( pSoldier->CanUseRadio() )
|
if ( pSoldier->CanUseRadio(FALSE) )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
//bSlot = FindObj( pSoldier, EXTENDEDEAR );
|
|
||||||
bSlot = FindHearingAid(pSoldier);
|
bSlot = FindHearingAid(pSoldier);
|
||||||
//ScreenMsg( FONT_WHITE, MSG_INTERFACE, L"Position: %d", bSlot );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (( bSlot == HEAD1POS ) || ( bSlot == HEAD2POS))
|
if (bSlot == HEAD1POS || bSlot == HEAD2POS)
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16570,7 +16570,7 @@ void SOLDIERTYPE::Strip()
|
|||||||
{
|
{
|
||||||
CreateItem( vestitem, 100, &gTempObject );
|
CreateItem( vestitem, 100, &gTempObject );
|
||||||
if ( !AutoPlaceObject( this, &gTempObject, FALSE ) )
|
if ( !AutoPlaceObject( this, &gTempObject, FALSE ) )
|
||||||
AddItemToPool( this->sGridNo, &gTempObject, 1, 0, 0, -1 );
|
AddItemToPool( this->sGridNo, &gTempObject, 1, this->pathing.bLevel, 0, -1 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_NO_CLOTHES_ITEM] );
|
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_NO_CLOTHES_ITEM] );
|
||||||
@@ -16583,7 +16583,7 @@ void SOLDIERTYPE::Strip()
|
|||||||
{
|
{
|
||||||
CreateItem( pantsitem, 100, &gTempObject );
|
CreateItem( pantsitem, 100, &gTempObject );
|
||||||
if ( !AutoPlaceObject( this, &gTempObject, FALSE ) )
|
if ( !AutoPlaceObject( this, &gTempObject, FALSE ) )
|
||||||
AddItemToPool( this->sGridNo, &gTempObject, 1, 0, 0, -1 );
|
AddItemToPool(this->sGridNo, &gTempObject, 1, this->pathing.bLevel, 0, -1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_NO_CLOTHES_ITEM] );
|
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_NO_CLOTHES_ITEM] );
|
||||||
@@ -18509,7 +18509,7 @@ BOOLEAN SOLDIERTYPE::CanUseRadio( BOOLEAN fCheckForAP )
|
|||||||
if ( !NUM_SKILL_TRAITS( this, RADIO_OPERATOR_NT ) )
|
if ( !NUM_SKILL_TRAITS( this, RADIO_OPERATOR_NT ) )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
// if we check wether we have enough AP, exit if we don't
|
// if we check whether we have enough AP, exit if we don't
|
||||||
if ( fCheckForAP && !EnoughPoints( this, APBPConstants[AP_RADIO], 0, FALSE ) )
|
if ( fCheckForAP && !EnoughPoints( this, APBPConstants[AP_RADIO], 0, FALSE ) )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
@@ -22706,7 +22706,7 @@ void SOLDIERTYPE::EVENT_SoldierApplyItemToPerson( INT32 sGridNo, UINT8 ubDirecti
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// no gasmask is worn, and both faceslots are occupied - remove the item in slot 2 and put the gasmask there
|
// no gasmask is worn, and both face slots are occupied - remove the item in slot 2 and put the gasmask there
|
||||||
AddItemToPool( pSoldier->sGridNo, &(pSoldier->inv[HEAD2POS]), 1, pSoldier->pathing.bLevel, 0, -1 );
|
AddItemToPool( pSoldier->sGridNo, &(pSoldier->inv[HEAD2POS]), 1, pSoldier->pathing.bLevel, 0, -1 );
|
||||||
|
|
||||||
success = PlaceObject( pSoldier, HEAD2POS, pObj );
|
success = PlaceObject( pSoldier, HEAD2POS, pObj );
|
||||||
|
|||||||
Reference in New Issue
Block a user