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:
Sevenfm
2021-02-17 20:31:44 +00:00
parent 417fa661c6
commit f3d35c9401
3 changed files with 9 additions and 18 deletions
+3 -7
View File
@@ -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
{ {
+2 -7
View File
@@ -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;
} }
+4 -4
View File
@@ -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 );