-added a couple extra checks to Inventory Choosing.cpp for attachments. Doubt it will fix the battle/sniper scope conflict though.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@171 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
MaddMugsy
2006-06-05 06:17:23 +00:00
parent 7da7984951
commit 26adc690ed
+29 -18
View File
@@ -672,36 +672,47 @@ void ChooseWeaponForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bWeaponC
if ( Item[usGunIndex].defaultattachment > 0 )
{
//check for incompatibilities
for(i = 0;i<sizeof(IncompatibleAttachments);i++)
{
if ( IncompatibleAttachments[i][0] == NONE )
break;
if ( IncompatibleAttachments[i][0] == usAttachIndex && IncompatibleAttachments[i][1] == Item[usGunIndex].defaultattachment )
{
// default attachment wins
usAttachIndex = 0;
break;
}
}
if ( usScopeIndex > 0 )
if ( Item[usGunIndex].defaultattachment == usAttachIndex )
usAttachIndex = 0;
else
{
//check for incompatibilities w/scope
//check for incompatibilities
for(i = 0;i<sizeof(IncompatibleAttachments);i++)
{
if ( IncompatibleAttachments[i][0] == NONE )
break;
if ( IncompatibleAttachments[i][0] == usScopeIndex && IncompatibleAttachments[i][1] == Item[usGunIndex].defaultattachment )
if ( IncompatibleAttachments[i][0] == usAttachIndex && IncompatibleAttachments[i][1] == Item[usGunIndex].defaultattachment )
{
// default attachment wins
usScopeIndex = 0;
usAttachIndex = 0;
break;
}
}
}
if ( usScopeIndex > 0 )
{
if ( Item[usGunIndex].defaultattachment == usScopeIndex )
usScopeIndex = 0;
else
{
//check for incompatibilities w/scope
for(i = 0;i<sizeof(IncompatibleAttachments);i++)
{
if ( IncompatibleAttachments[i][0] == NONE )
break;
if ( IncompatibleAttachments[i][0] == usScopeIndex && IncompatibleAttachments[i][1] == Item[usGunIndex].defaultattachment )
{
// default attachment wins
usScopeIndex = 0;
break;
}
}
}
}
}
else if ( usScopeIndex > 0 )
{
@@ -725,7 +736,7 @@ void ChooseWeaponForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bWeaponC
if ( ( bAttachClass - Item[usAttachIndex].ubCoolness ) > 0 && Random(2) )
{
usAttachIndex2 = PickARandomAttachment(ATTACHMENTS,usGunIndex,bAttachClass,FALSE);
//check for incompatibilities with 1st attachment
for(i = 0;i<sizeof(IncompatibleAttachments);i++)
{