From 2911bffcedee7a4a2089d767466c3b6da839f6f0 Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Mon, 18 Jul 2016 21:43:08 -0400 Subject: [PATCH] Fix can't reload partial mag with flares in inventory Vanilla development commits: https://github.com/DayZMod/DayZ/commit/7f7d3e02e786b0a2fee9cb9af1353f5b28a9eda6 https://github.com/DayZMod/DayZ/commit/094f1f18d2444c4e3ecca5a5b4b3538cc333d606 https://github.com/DayZMod/DayZ/commit/a078e84f11c7829e4830f5397cc50956eaee381a https://github.com/DayZMod/DayZ/commit/805b9def10b8d26d00950e98fe87dcf74e8e06ea Also reverted: https://github.com/EpochModTeam/DayZ-Epoch/commit/51be8aa8a5009b471c9dcfcd3ae3c0a362b7121b since it was not the cause. See https://github.com/DayZMod/DayZ/issues/641 for the details. --- SQF/dayz_code/Configs/CfgWeapons/Throw.hpp | 142 ++++++++++++--------- SQF/dayz_code/Configs/cfgAmmo.hpp | 21 +-- SQF/dayz_code/compile/keyboard.sqf | 2 +- 3 files changed, 97 insertions(+), 68 deletions(-) diff --git a/SQF/dayz_code/Configs/CfgWeapons/Throw.hpp b/SQF/dayz_code/Configs/CfgWeapons/Throw.hpp index b43f6b9fa..fc939704e 100644 --- a/SQF/dayz_code/Configs/CfgWeapons/Throw.hpp +++ b/SQF/dayz_code/Configs/CfgWeapons/Throw.hpp @@ -1,37 +1,67 @@ class Throw : GrenadeLauncher { - autoReload = true; - backgroundReload = true; +/* + scope = public; + autoAimEnabled = false; + cursor = "Vehicle_Grenade_W"; + cursoraim = "\ca\Weapons\Data\clear_empty"; + cursorSize = 1; + value = 0; + type = VSoft; + displayName = $STR_MAG_ACTION2_4; + canDrop = false; + //autoReload = true; + //backgroundReload = true; +*/ muzzles[] = { - HandGrenadeMuzzle, - SmokeShellMuzzle, - - RoadFlareMuzzle, - ChemLightMuzzle, - TrashMuzzle + "HandGrenadeMuzzle", + "SmokeShellMuzzle", + "RoadFlareMuzzle", + "ChemLightMuzzle", + "TrashMuzzle" }; class ThrowMuzzle : GrenadeLauncher { + /* + cursoraim = "Vehicle_Grenade_W"; + cursorSize = 1; + sound[] = {"", 0.000316228, 1}; + reloadSound[] = {"", 0.000316228, 1}; + aiDispersionCoefX = 6; + aiDispersionCoefY = 6; + reloadTime = 0; + magazineReloadTime = 0; + enableAttack = false; + showEmpty = 0; + autoReload = true; + modelOptics = ""; + minRange = 30; + minRangeProbab = 0.5; + midRange = 45; + midRangeProbab = 0.2; + maxRange = 60; + maxRangeProbab = 0.03; + */ cursor = "\ca\Weapons\Data\clear_empty"; - backgroundReload = true; + //backgroundReload = true; }; class RoadFlareMuzzle : ThrowMuzzle { displayName = $STR_MAG_ACTION_4; - magazines[] = {HandRoadFlare}; + magazines[] = {"HandRoadFlare"}; begin1[] = {"dayz_weapons\sounds\roadflare_start", 1.77828, 1, 1000}; - soundBegin[] = {begin1, 1}; + soundBegin[] = {"begin1", 1}; }; class ChemLightMuzzle : ThrowMuzzle { displayName = $STR_MAG_ACTION_5; - magazines[] = {HandChemGreen, HandChemRed, HandChemBlue}; + magazines[] = {"HandChemGreen", "HandChemRed", "HandChemBlue"}; }; class TrashMuzzle : ThrowMuzzle @@ -39,51 +69,49 @@ class Throw : GrenadeLauncher displayName = $STR_ACTION_THROW; magazines[] = { - TrashJackDaniels, - - TrashTinCan, - FoodCanGriffEmpty, - FoodCanBadguyEmpty, - FoodCanBoneboyEmpty, - FoodCanCornEmpty, - FoodCanCurgonEmpty, - FoodCanDemonEmpty, - FoodCanFraggleosEmpty, - FoodCanHerpyEmpty, - FoodCanDerpyEmpty, - FoodCanOrlokEmpty, - FoodCanPowellEmpty, - FoodCanTylersEmpty, - FoodCanUnlabeledEmpty, - FoodCanRusUnlabeledEmpty, - FoodCanRusPorkEmpty, - FoodCanRusPeasEmpty, - FoodCanRusMilkEmpty, - FoodCanRusCornEmpty, - FoodCanRusStewEmpty, - FoodCanBeefEmpty, - FoodCanPotatoesEmpty, - - ItemSodaEmpty, - ItemSodaClaysEmpty, - ItemSodaCokeEmpty, - ItemSodaDrwasteEmpty, - ItemSodaFrankaEmpty, - ItemSodaGrapeDrinkEmpty, - ItemSodaLemonadeEmpty, - ItemSodaLirikEmpty, - ItemSodaLvgEmpty, - ItemSodaMdewEmpty, - ItemSodaMtngreenEmpty, - ItemSodaMzlyEmpty, - ItemSodaPeppsyEmpty, - ItemSodaPepsiEmpty, - ItemSodaR4z0rEmpty, - ItemSodaRabbitEmpty, - ItemSodaRocketFuelEmpty, - ItemSodaSacriteEmpty, - ItemSodaSherbetEmpty, - ItemSodaSmashtEmpty + "TrashJackDaniels", + "TrashTinCan", + "FoodCanGriffEmpty", + "FoodCanBadguyEmpty", + "FoodCanBoneboyEmpty", + "FoodCanCornEmpty", + "FoodCanCurgonEmpty", + "FoodCanDemonEmpty", + "FoodCanFraggleosEmpty", + "FoodCanHerpyEmpty", + "FoodCanDerpyEmpty", + "FoodCanOrlokEmpty", + "FoodCanPowellEmpty", + "FoodCanTylersEmpty", + "FoodCanUnlabeledEmpty", + "FoodCanRusUnlabeledEmpty", + "FoodCanRusPorkEmpty", + "FoodCanRusPeasEmpty", + "FoodCanRusMilkEmpty", + "FoodCanRusCornEmpty", + "FoodCanRusStewEmpty", + "FoodCanBeefEmpty", + "FoodCanPotatoesEmpty", + "ItemSodaEmpty", + "ItemSodaClaysEmpty", + "ItemSodaCokeEmpty", + "ItemSodaDrwasteEmpty", + "ItemSodaFrankaEmpty", + "ItemSodaGrapeDrinkEmpty", + "ItemSodaLemonadeEmpty", + "ItemSodaLirikEmpty", + "ItemSodaLvgEmpty", + "ItemSodaMdewEmpty", + "ItemSodaMtngreenEmpty", + "ItemSodaMzlyEmpty", + "ItemSodaPeppsyEmpty", + "ItemSodaPepsiEmpty", + "ItemSodaR4z0rEmpty", + "ItemSodaRabbitEmpty", + "ItemSodaRocketFuelEmpty", + "ItemSodaSacriteEmpty", + "ItemSodaSherbetEmpty", + "ItemSodaSmashtEmpty" }; }; }; \ No newline at end of file diff --git a/SQF/dayz_code/Configs/cfgAmmo.hpp b/SQF/dayz_code/Configs/cfgAmmo.hpp index c9643af72..8f3940261 100644 --- a/SQF/dayz_code/Configs/cfgAmmo.hpp +++ b/SQF/dayz_code/Configs/cfgAmmo.hpp @@ -1,4 +1,4 @@ -class CfgAmmo +class CfgAmmo { class Default; class BulletBase; @@ -6,7 +6,7 @@ class CfgAmmo class GrenadeCore; /* MELEE */ - + class Melee : Default { //Simulation @@ -306,7 +306,7 @@ class CfgAmmo /* BULLET */ - + //.44 Henry Winchester 1866 class B_1866_Slug : BulletBase { @@ -321,9 +321,9 @@ class CfgAmmo airFriction = -0.005; caliber = 0.5; }; - + //makarov - class B_9x18_Ball : BulletBase + class B_9x18_Ball : BulletBase { airfriction = -0.002751; audiblefire = 15; @@ -334,9 +334,9 @@ class CfgAmmo typicalspeed = 350; visiblefire = 15; }; - + //makarov sd - class B_9x18_SD : B_9x18_Ball + class B_9x18_SD : B_9x18_Ball { airfriction = -0.001893; audiblefire = 0.035; @@ -346,9 +346,9 @@ class CfgAmmo visiblefire = 0.035; visiblefiretime = 2; }; - + //M1911 - class B_45ACP_Ball : BulletBase + class B_45ACP_Ball : BulletBase { airfriction = -0.0013522; audiblefire = 16; @@ -438,6 +438,7 @@ class CfgAmmo simulationStep = 1; soundFly[] = {"dayz_weapons\sounds\roadflare", 0.316228, 1, 60}; cost = 100; + explosive = false; deflecting = 60; explosionTime = 0; timeToLive = 300; @@ -483,7 +484,7 @@ class CfgAmmo - + // used for grenade traps class GrenadeHandTimedWest; class GrenadeHandTimedWest_DZ : GrenadeHandTimedWest diff --git a/SQF/dayz_code/compile/keyboard.sqf b/SQF/dayz_code/compile/keyboard.sqf index e56c35832..52d431e1b 100644 --- a/SQF/dayz_code/compile/keyboard.sqf +++ b/SQF/dayz_code/compile/keyboard.sqf @@ -90,7 +90,7 @@ if (isNil "keyboard_keys") then { }; } forEach getArray(configFile >> "cfgWeapons" >> _weapon >> _muzz >> "magazines"); } forEach _muzzles; - } forEach [ "Throw"]; + } forEach ["Throw"]; _magCount = count _ammo_throwable; if (_magCount > 0) then {