mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
Added helper functions to easier determine gun stats
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9158 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -15832,3 +15832,33 @@ BOOLEAN CanDelayGrenadeExplosion( UINT16 usItem )
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
FLOAT GetBestScopeMagFactorForGun(UINT16 ausItemGun)
|
||||
{
|
||||
FLOAT bestscopemagfactor = 1.0f;
|
||||
|
||||
for ( UINT16 usItem = 1; usItem < gMAXITEMS_READ; ++usItem )
|
||||
{
|
||||
if ( ValidAttachment( usItem, ausItemGun ) )
|
||||
{
|
||||
if ( bestscopemagfactor < Item[usItem].scopemagfactor )
|
||||
bestscopemagfactor = Item[usItem].scopemagfactor;
|
||||
}
|
||||
}
|
||||
|
||||
return bestscopemagfactor;
|
||||
}
|
||||
|
||||
bool HasScopeMagFactorForGun( UINT16 ausItemGun, FLOAT aFactor )
|
||||
{
|
||||
for ( UINT16 usItem = 1; usItem < gMAXITEMS_READ; ++usItem )
|
||||
{
|
||||
if ( ValidAttachment( usItem, ausItemGun ) )
|
||||
{
|
||||
if ( std::fabs( Item[usItem].scopemagfactor - aFactor ) < 0.1 )
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user