mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
-updated IMP Confirm.cpp to not choose illegal items from impitemchoices.xml (illegal = not on big gun list, coolness = 0)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@141 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+1
-1
@@ -23,7 +23,7 @@ INT16 zVersionLabel[256] = { L"Beta v. 0.98" };
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
//RELEASE BUILD VERSION
|
//RELEASE BUILD VERSION
|
||||||
INT16 zVersionLabel[256] = { L"Release v1.13.139" };
|
INT16 zVersionLabel[256] = { L"Release v1.13.141" };
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+23
-18
@@ -818,9 +818,13 @@ void GiveIMPRandomItems( MERCPROFILESTRUCT *pProfile, UINT8 typeIndex )
|
|||||||
|
|
||||||
for ( int i=0; i < gIMPItemChoices[typeIndex].ubNumItems ;i++ )
|
for ( int i=0; i < gIMPItemChoices[typeIndex].ubNumItems ;i++ )
|
||||||
{
|
{
|
||||||
iChoice = Random(gIMPItemChoices[ typeIndex ].ubChoices);
|
while (usItem == 0 )
|
||||||
usItem = gIMPItemChoices[ typeIndex ].bItemNo[ iChoice ];
|
{
|
||||||
|
iChoice = Random(gIMPItemChoices[ typeIndex ].ubChoices);
|
||||||
|
usItem = gIMPItemChoices[ typeIndex ].bItemNo[ iChoice ];
|
||||||
|
if (!ItemIsLegal(usItem))
|
||||||
|
usItem=0;
|
||||||
|
}
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPRandomItems: typeIndex = %d, usItem = %d ",typeIndex, usItem ));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPRandomItems: typeIndex = %d, usItem = %d ",typeIndex, usItem ));
|
||||||
if ( usItem > 0 )
|
if ( usItem > 0 )
|
||||||
MakeProfileInvItemAnySlot(pProfile,usItem,100,1);
|
MakeProfileInvItemAnySlot(pProfile,usItem,100,1);
|
||||||
@@ -865,26 +869,27 @@ void GiveIMPItems( MERCPROFILESTRUCT *pProfile, INT8 abilityValue, UINT8 typeInd
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPItems: 2 iChoice = %d",iChoice));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPItems: 2 iChoice = %d",iChoice));
|
||||||
usItem = gIMPItemChoices[ typeIndex ].bItemNo[ iChoice ];
|
usItem = gIMPItemChoices[ typeIndex ].bItemNo[ iChoice ];
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPItems: typeIndex = %d, usItem = %d, iChoice = %d, abilityValue = %d",typeIndex, usItem,iChoice, abilityValue ));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPItems: typeIndex = %d, usItem = %d, iChoice = %d, abilityValue = %d",typeIndex, usItem,iChoice, abilityValue ));
|
||||||
if ( usItem > 0 )
|
if ( usItem > 0 && ItemIsLegal(usItem))
|
||||||
|
{
|
||||||
MakeProfileInvItemAnySlot(pProfile,usItem,100,1);
|
MakeProfileInvItemAnySlot(pProfile,usItem,100,1);
|
||||||
|
|
||||||
|
|
||||||
// give ammo for guns
|
// give ammo for guns
|
||||||
if ( Item[usItem].usItemClass == IC_GUN && !Item[usItem].rocketlauncher )
|
if ( Item[usItem].usItemClass == IC_GUN && !Item[usItem].rocketlauncher )
|
||||||
{
|
{
|
||||||
usItem = DefaultMagazine(usItem);
|
usItem = DefaultMagazine(usItem);
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPItems: give ammo typeIndex = %d, usItem = %d",typeIndex, usItem ));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPItems: give ammo typeIndex = %d, usItem = %d",typeIndex, usItem ));
|
||||||
MakeProfileInvItemAnySlot(pProfile,usItem,100,(1+Random(3)));
|
MakeProfileInvItemAnySlot(pProfile,usItem,100,(1+Random(3)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// give launchables for launchers
|
// give launchables for launchers
|
||||||
if ( Item[usItem].usItemClass == IC_LAUNCHER )
|
if ( Item[usItem].usItemClass == IC_LAUNCHER )
|
||||||
{
|
{
|
||||||
usItem = PickARandomLaunchable(usItem);
|
usItem = PickARandomLaunchable(usItem);
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPItems: give launchable typeIndex = %d, usItem = %d",typeIndex, usItem ));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPItems: give launchable typeIndex = %d, usItem = %d",typeIndex, usItem ));
|
||||||
MakeProfileInvItemAnySlot(pProfile,usItem,100,(1+Random(3)));
|
MakeProfileInvItemAnySlot(pProfile,usItem,100,(1+Random(3)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
iChoice--;
|
iChoice--;
|
||||||
if (iChoice < 0)
|
if (iChoice < 0)
|
||||||
iChoice = 0;
|
iChoice = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user