mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
fix: sometimes, wrong clothes were taken off
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5568 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+17
-3
@@ -14652,6 +14652,11 @@ BOOLEAN GetFirstClothesItemWithSpecificData( UINT16* pusItem, PaletteRepID aPalV
|
|||||||
if ( !GetPaletteRepIndexFromID(aPalPants, &filler) )
|
if ( !GetPaletteRepIndexFromID(aPalPants, &filler) )
|
||||||
pantsok = TRUE;
|
pantsok = TRUE;
|
||||||
|
|
||||||
|
// getting the best item isn't straightforward. As combo clothes can be found first, we will search for each item whose clothestype matches, and retreive the loest item that has
|
||||||
|
// the lowest clothestype
|
||||||
|
UINT32 bestclothestype = 999999;
|
||||||
|
UINT16 bestitem = 0;
|
||||||
|
|
||||||
register UINT16 i;
|
register UINT16 i;
|
||||||
for (i = 1; i < MAXITEMS; ++i)
|
for (i = 1; i < MAXITEMS; ++i)
|
||||||
{
|
{
|
||||||
@@ -14682,12 +14687,21 @@ BOOLEAN GetFirstClothesItemWithSpecificData( UINT16* pusItem, PaletteRepID aPalV
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( tmpvestok && tmppantsok )
|
if ( tmpvestok && tmppantsok )
|
||||||
{
|
{
|
||||||
*pusItem = i;
|
if ( Item[i].clothestype < bestclothestype )
|
||||||
return( TRUE );
|
{
|
||||||
|
bestclothestype = Item[i].clothestype;
|
||||||
|
bestitem = i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( bestitem > 0 )
|
||||||
|
{
|
||||||
|
*pusItem = bestitem;
|
||||||
|
return( TRUE );
|
||||||
|
}
|
||||||
|
|
||||||
return( FALSE );
|
return( FALSE );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user