mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
Fix: When defusing a gun trap, the attached gun vanished
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7782 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -5542,6 +5542,26 @@ void BoobyTrapMessageBoxCallBack( UINT8 ubExitValue )
|
||||
}
|
||||
else
|
||||
{
|
||||
// if this is a tripwire, it might have an attached gun, which we also have to spawn
|
||||
if ( Item[gTempObject.usItem].tripwire )
|
||||
{
|
||||
// search for attached guns
|
||||
OBJECTTYPE* pAttGun = NULL;
|
||||
|
||||
// check all attachments
|
||||
attachmentList::iterator iterend = gTempObject[0]->attachments.end( );
|
||||
for ( attachmentList::iterator iter = gTempObject[0]->attachments.begin( ); iter != iterend; ++iter )
|
||||
{
|
||||
if ( iter->exists( ) && Item[iter->usItem].usItemClass == IC_GUN )
|
||||
{
|
||||
pAttGun = &(*iter);
|
||||
|
||||
// add this gun to the floor
|
||||
AddItemToPool( gsBoobyTrapGridNo, pAttGun, 1, gbBoobyTrapLevel, 0, -1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// switch action item to the real item type
|
||||
// sevenfm: added check to only switch action items and not regular explosives
|
||||
// this allows to keep all attachments
|
||||
|
||||
Reference in New Issue
Block a user