- Code Improvement: it is now no longer necessary for the 'Full Sandbag' item to have a specific item number. The correct number will now be searched once per game.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5391 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2012-07-11 23:06:37 +00:00
parent 0d550743a7
commit 5f680b499a
3 changed files with 25 additions and 49 deletions
+16
View File
@@ -13949,3 +13949,19 @@ BOOLEAN HasItemFlag( UINT16 usItem, UINT32 aFlag )
{
return( (Item[usItem].usItemFlag & aFlag) != 0 );
}
// Flugente: get first item number that has this flag. Use with caution, as we search in all items
BOOLEAN GetFirstItemWithFlag( UINT16* pusItem, UINT32 aFlag )
{
register UINT16 i;
for (i = 1; i < MAXITEMS; ++i)
{
if ( HasItemFlag(i, aFlag) )
{
(*pusItem) = i;
return( TRUE );
}
}
return( FALSE );
}