mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
Use MAXITEMS + 1 max limit when checking transformations.
UpdateAttachmentTooltips: - separate items, launchables and attachments checks as they have different max limits - improved searching of existing item in vector git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8924 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -8498,7 +8498,7 @@ void HandleTacticalTransformItem(void)
|
||||
BOOLEAN FindTransformation( UINT16 usItem, TransformInfoStruct **pTransformation )
|
||||
{
|
||||
// find transformation
|
||||
for ( UINT32 x = 0; x < gMAXITEMS_READ; ++x )
|
||||
for ( UINT32 x = 0; x < MAXITEMS + 1; ++x )
|
||||
{
|
||||
if ( Transform[x].usItem == (UINT16)-1 )
|
||||
{
|
||||
@@ -9034,7 +9034,7 @@ void HandleTacticalTransformFlashlight(void)
|
||||
BOOLEAN FindLaserTransformation(UINT16 usItem, TransformInfoStruct **pTransformation)
|
||||
{
|
||||
// find transformation
|
||||
for (INT32 x = 0; x < MAXITEMS; x++)
|
||||
for (INT32 x = 0; x < MAXITEMS + 1; x++)
|
||||
{
|
||||
if (Transform[x].usItem == (UINT16)-1)
|
||||
{
|
||||
@@ -9060,7 +9060,7 @@ BOOLEAN FindScopeTransformation(UINT16 usItem, TransformInfoStruct **pTransforma
|
||||
// search for higher magnification first
|
||||
iFoundIndex = MAXITEMS;
|
||||
scope = Item[usItem].scopemagfactor;
|
||||
for (INT32 x = 0; x < MAXITEMS; x++)
|
||||
for (INT32 x = 0; x < MAXITEMS + 1; x++)
|
||||
{
|
||||
if (Transform[x].usItem == (UINT16)-1)
|
||||
{
|
||||
@@ -9087,7 +9087,7 @@ BOOLEAN FindScopeTransformation(UINT16 usItem, TransformInfoStruct **pTransforma
|
||||
// search for lowest magnification
|
||||
iFoundIndex = MAXITEMS;
|
||||
scope = Item[usItem].scopemagfactor;
|
||||
for (INT32 x = 0; x < MAXITEMS; x++)
|
||||
for (INT32 x = 0; x < MAXITEMS + 1; x++)
|
||||
{
|
||||
if (Transform[x].usItem == (UINT16)-1)
|
||||
{
|
||||
@@ -9111,7 +9111,7 @@ BOOLEAN FindScopeTransformation(UINT16 usItem, TransformInfoStruct **pTransforma
|
||||
}
|
||||
|
||||
// search for any transformation
|
||||
for (INT32 x = 0; x < MAXITEMS; x++)
|
||||
for (INT32 x = 0; x < MAXITEMS + 1; x++)
|
||||
{
|
||||
if (Transform[x].usItem == (UINT16)-1)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user