mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Overheating - Minor performance tweaks (#5739)
* Don't try to cool down an already cooled barrel * Don't run the projectile direction update routine if we know that the max. possible deflection is < 0.05 mrad
This commit is contained in:
parent
9e11e39eb0
commit
d4c4e68e42
@ -19,6 +19,7 @@
|
||||
|
||||
params ["_temperature", "_barrelMass", "_totalTime"];
|
||||
|
||||
if (_temperature < 1) exitWith {0};
|
||||
// If a long time passed since the last shot, there's no need to calculate anything; the weapon should be cool
|
||||
if (_totalTime > 1800) exitWith {0};
|
||||
|
||||
|
@ -41,7 +41,7 @@ TRACE_2("Unit fired with temp:",_unit,_temperature);
|
||||
TRACE_4("weapon data from cache",_weapon,_dispersion,_slowdownFactor,_jamChance);
|
||||
|
||||
// Dispersion and bullet slow down
|
||||
if (GVAR(overheatingDispersion)) then {
|
||||
if (GVAR(overheatingDispersion) && _scaledTemperature > 0.1) then {
|
||||
// Exit if GVAR(pseudoRandomList) isn't synced yet
|
||||
if (isNil QGVAR(pseudoRandomList)) exitWith {ERROR("No pseudoRandomList sync");};
|
||||
|
||||
@ -68,7 +68,7 @@ if (_unit != ACE_player && (!GVAR(showParticleEffectsForEveryone) || {_unit dist
|
||||
};
|
||||
|
||||
//Particle Effects:
|
||||
if (GVAR(showParticleEffects) && {(CBA_missionTime > ((_unit getVariable [QGVAR(lastDrop), -1000]) + 0.40)) && {_scaledTemperature > 0.1}}) then {
|
||||
if (GVAR(showParticleEffects) && _scaledTemperature > 0.1 && {CBA_missionTime > (_unit getVariable [QGVAR(lastDrop), -1000]) + 0.40}) then {
|
||||
_unit setVariable [QGVAR(lastDrop), CBA_missionTime];
|
||||
|
||||
private _direction = (_unit weaponDirection _weapon) vectorMultiply 0.25;
|
||||
|
Loading…
Reference in New Issue
Block a user