Code cleanup

This commit is contained in:
PabstMirror 2015-02-11 15:43:08 -06:00
parent 24bd515814
commit 7545a6c3d8
3 changed files with 14 additions and 11 deletions

View File

@ -1,13 +1,10 @@
class CfgSounds
{
class GVAR(soundMagazineFinished)
{
class CfgSounds {
class GVAR(soundMagazineFinished) {
name = QGVAR(soundMagazineFinished);
sound[]={QUOTE(PATHTOF(sounds\magrepack_finished.wav)),1,1};
titles[]={};
};
class GVAR(soundRoundFinished)
{
class GVAR(soundRoundFinished) {
name = QGVAR(soundRoundFinished);
sound[] = {QUOTE(PATHTOF(sounds\magrepack_single.wav)),1,1};
titles[] = {};

View File

@ -16,7 +16,13 @@ class CfgPatches {
#include "CfgSounds.hpp"
#include "CfgVehicles.hpp"
class ACE_Parameters_Numeric {
GVAR(TimePerAmmo) = 1.5;
GVAR(TimePerMagazine) = 2.0;
class ACE_Settings {
class GVAR(TimePerAmmo) {
value = 1.5;
typeName = "SCALAR";
};
class GVAR(TimePerMagazine) {
value = 2.0;
typeName = "SCALAR";
};
};

View File

@ -63,13 +63,13 @@ _updateMagazinesOnPlayerFnc = {
};
if (_nextEventIsBullet) then {
playSound QGVAR(soundMagazineFinished);
playSound QGVAR(soundRoundFinished);
if ((((count _simEvents) % 3) == 0) || {(count _simEvents) == 1}) then {
//For performance - only update mags every 3 bullets (or if it's the last event)
call _updateMagazinesOnPlayerFnc;
};
} else {
playSound QGVAR(soundRoundFinished);
playSound QGVAR(soundMagazineFinished);
call _updateMagazinesOnPlayerFnc;
};