From f24d417ac1b60d0fbee3619bc3e957bc5926a983 Mon Sep 17 00:00:00 2001 From: silversurfer Date: Thu, 21 May 2015 18:59:13 +0000 Subject: [PATCH] Enhanced the change from 7871 as the game doesn't distinguish between doors and containers. They are all "doors" in code terms. Now any "door" that doesn't have a key item assigned is considered a container. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7872 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Handle Doors.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Tactical/Handle Doors.cpp b/Tactical/Handle Doors.cpp index 6ade888a..da47cbe9 100644 --- a/Tactical/Handle Doors.cpp +++ b/Tactical/Handle Doors.cpp @@ -773,8 +773,9 @@ BOOLEAN HandleOpenableStruct( SOLDIERTYPE *pSoldier, INT32 sGridNo, STRUCTURE *p { pSoldier->DoMercBattleSound( BATTLE_SOUND_COOL1 ); //ScreenMsg( MSG_FONT_YELLOW, MSG_INTERFACE, TacticalStr[ DOOR_LOCK_DESTROYED_STR ] ); - // silversurfer: removed this so the merc can blow a lock without directly opening the door and remain helpless with no AP to do something - //fHandleDoor = TRUE; + // silversurfer: changed this so the merc can blow a lock without directly opening the door and remain helpless with no AP to do something. Doors have usKeyItem > 0. + if ( LockTable[ pDoor->ubLockID ].usKeyItem == 0 ) + fHandleDoor = TRUE; } else { @@ -802,8 +803,9 @@ BOOLEAN HandleOpenableStruct( SOLDIERTYPE *pSoldier, INT32 sGridNo, STRUCTURE *p { pSoldier->DoMercBattleSound( BATTLE_SOUND_COOL1 ); //ScreenMsg( MSG_FONT_YELLOW, MSG_INTERFACE, TacticalStr[ DOOR_LOCK_HAS_BEEN_PICKED_STR ] ); - // silversurfer: removed this so the merc can pick a lock without directly opening the door and remain helpless with no AP to do something - //fHandleDoor = TRUE; + // silversurfer: changed this so the merc can pick a lock without directly opening the door and remain helpless with no AP to do something. Doors have usKeyItem > 0. + if ( LockTable[ pDoor->ubLockID ].usKeyItem == 0 ) + fHandleDoor = TRUE; } else { @@ -892,8 +894,9 @@ BOOLEAN HandleOpenableStruct( SOLDIERTYPE *pSoldier, INT32 sGridNo, STRUCTURE *p pSoldier->ChangeSoldierState( GetAnimStateForInteraction( pSoldier, fDoor, END_OPEN_DOOR ), 0, FALSE ); UpdateDoorPerceivedValue( pDoor ); - // silversurfer: removed this so the merc can unlock a door without directly opening it and remain helpless with no AP to do something - //fHandleDoor = TRUE; + // silversurfer: changed this so the merc can unlock a door without directly opening it and remain helpless with no AP to do something. Doors have usKeyItem > 0. + if ( LockTable[ pDoor->ubLockID ].usKeyItem == 0 ) + fHandleDoor = TRUE; } else {