From 925e3796d6a5b1fd58603d08a37977b3ce44bd5b Mon Sep 17 00:00:00 2001 From: VoidLinux Date: Sun, 17 Nov 2024 19:09:45 +0300 Subject: [PATCH] Improvement #556 --- Src/host/GameObjects/GameObject.sqf | 8 +++++--- Src/host/GameObjects/Mobs/Mob_Combat.sqf | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Src/host/GameObjects/GameObject.sqf b/Src/host/GameObjects/GameObject.sqf index 7ed301d1..7651d8ae 100644 --- a/Src/host/GameObjects/GameObject.sqf +++ b/Src/host/GameObjects/GameObject.sqf @@ -1313,9 +1313,11 @@ region(throwing and bullets functions) _thDamModif = callFunc(_matObj,getDamageCoefOnAttack); }; - private _weapDamage = round(_dam*_thDamModif) - _drObj; - //! THIS CAN BE THROWS ERROR BECAUSE _throwed.loc - is flyingObject - callFuncParams(_throwed,applyDamage,_weapDamage arg _type arg _p arg "throwed"); + if ([getVar(_throwed,ht)] call gurps_probSuccess) then { + private _weapDamage = round(_dam*_thDamModif) - _drObj; + //! THIS CAN BE THROWS ERROR BECAUSE _throwed.loc - is flyingObject + callFuncParams(_throwed,applyDamage,_weapDamage arg _type arg _p arg "throwed"); + }; }; //Тут обязательно нужно удалить пулю чтобы не вызывать утечек памяти diff --git a/Src/host/GameObjects/Mobs/Mob_Combat.sqf b/Src/host/GameObjects/Mobs/Mob_Combat.sqf index 0a7a7aa8..89b99261 100644 --- a/Src/host/GameObjects/Mobs/Mob_Combat.sqf +++ b/Src/host/GameObjects/Mobs/Mob_Combat.sqf @@ -234,8 +234,10 @@ func(attackOtherObj) callFuncParams(_target,applyDamage,_basicDamage arg _dType arg callSelf(getLastInteractEndPos) arg "attack"); //conv attack to -> _dir arg di_partDamage arg vec2(_attItem,_attWeapon) - //weapon damage after attack - callFuncParams(_attItem,applyDamage,_weapDamage max 0 arg _dType arg callSelf(getLastInteractStartPos) arg "weap_attack"); + if ([getVar(_attItem,ht)] call gurps_probSuccess) then { + //weapon damage after attack + callFuncParams(_attItem,applyDamage,_weapDamage max 0 arg _dType arg callSelf(getLastInteractStartPos) arg "weap_attack"); + }; //callSelfParams(onDamageMessage,_target arg _attWeapMes arg _attackedZoneText arg _attRealTargetZone arg _postMessageEffect); };// _delegate_damage