mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
- 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:
@@ -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 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user