Minor code improvements

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9147 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2021-07-24 19:16:12 +00:00
parent ed82841e3c
commit 58379b84cd
2 changed files with 9 additions and 12 deletions
+8 -11
View File
@@ -3568,28 +3568,25 @@ int i;
static int l_BoxerExists(lua_State *L)
{
BOOLEAN Bool;
Bool = BoxerExists( );
BOOLEAN Bool = BoxerExists( );
lua_pushboolean(L, Bool);
return 1;
return 1;
}
static int l_gubBoxerID(lua_State *L)
{
UINT8 n = lua_gettop(L);
UINT8 val, val2;
for (int i = 1; i <= n; i++)
if ( n >= 2 )
{
if (i == 1) val = lua_tointeger(L, i);
if (i == 2) val2 = lua_tointeger(L, i);
}
UINT8 val = lua_tointeger( L, 1 );
UINT8 val2 = lua_tointeger( L, 2 );
if (val <= 2)
gubBoxerID[val] = val2;
if ( val <= 2 )
gubBoxerID[val] = val2;
}
return 0;
}
+1 -1
View File
@@ -6407,7 +6407,7 @@ INT8 FireBulletGivenTargetTrapOnly( SOLDIERTYPE* pThrower, OBJECTTYPE* pObj, INT
}
else
{
ubVolume = __max( 1, ( ubVolume * GetPercentNoiseVolume( pObj ) ) / 100 );
ubVolume = __max( 1, ( ubVolume * noisefactor ) / 100 );
}
MakeNoise( NOBODY, gridno, 0, pThrower ? pThrower->bOverTerrainType : FLAT_GROUND, ubVolume, NOISE_GUNFIRE );