From e2d621a4c8894ca9ab2a17aae9c1820419f3fb71 Mon Sep 17 00:00:00 2001 From: vbawol Date: Mon, 8 Aug 2016 14:24:47 -0500 Subject: [PATCH] add no Krypto found message changed logic of dyna_isDeadPlayer to only allow typeOf Epoch_Male_F or Epoch_Female_F as isKindOf Man without the isplayer check would have returned for traders incorrectly. (unless we want killing traders to come with a Krypto payout) --- Sources/epoch_code/compile/traders/EPOCH_takeCrypto.sqf | 4 +++- .../epoch_config/Configs/CfgActionMenu/CfgActionMenu_core.hpp | 2 +- .../Configs/CfgActionMenu/CfgActionMenu_target.hpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Sources/epoch_code/compile/traders/EPOCH_takeCrypto.sqf b/Sources/epoch_code/compile/traders/EPOCH_takeCrypto.sqf index fd5ab205..32cb8e1c 100644 --- a/Sources/epoch_code/compile/traders/EPOCH_takeCrypto.sqf +++ b/Sources/epoch_code/compile/traders/EPOCH_takeCrypto.sqf @@ -5,7 +5,9 @@ if (!isNull _this) then { _getCrypto = _this getVariable["Crypto", 0]; if (_getCrypto > 0) then { [player, Epoch_personalToken, _this] remoteExec ["EPOCH_server_takeCrypto",2]; - [format["You found %1 Krypto.", _getCrypto], 5] call Epoch_message; + [format["You found %1 Krypto", _getCrypto], 5] call Epoch_message; + } else { + ["No Krypto found", 5] call Epoch_message; }; }; [] spawn{ diff --git a/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_core.hpp b/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_core.hpp index 5a7603ec..fbba0a09 100644 --- a/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_core.hpp +++ b/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_core.hpp @@ -28,7 +28,7 @@ class CfgActionMenu dyna_isVehicle = "if (!(isNull dyna_cursorTarget) && alive dyna_cursorTarget) then {((dyna_cursorTarget isKindOf 'LandVehicle') || (dyna_cursorTarget isKindOf 'Air') || (dyna_cursorTarget isKindOf 'Ship') || (dyna_cursorTarget isKindOf 'Tank'))} else {false}"; dyna_isTrader = "if (!(isNull dyna_cursorTarget) && alive dyna_cursorTarget) then {((dyna_cursorTarget isKindOf 'Man') && (dyna_cursorTarget != player) && (!isPlayer dyna_cursorTarget) && ((dyna_cursorTarget getVariable['AI_SLOT', -1]) != -1))} else {false}"; dyna_isPlayer = "if (!(isNull dyna_cursorTarget) && alive dyna_cursorTarget) then {((dyna_cursorTarget isKindOf 'Man') && (dyna_cursorTarget != player) && (isPlayer dyna_cursorTarget))} else {false}"; - dyna_isDeadPlayer = "if (!(isNull dyna_cursorTarget) && !(alive dyna_cursorTarget)) then {((dyna_cursorTarget isKindOf 'Man') && (dyna_cursorTarget != player))} else {false}"; + dyna_isDeadPlayer = "if (!(isNull dyna_cursorTarget) && !(alive dyna_cursorTarget)) then {(dyna_cursorTargetType in ['Epoch_Male_F','Epoch_Female_F'])} else {false}"; dyna_canAcceptTrade = "if (!(isNull EPOCH_pendingP2ptradeTarget) && alive EPOCH_pendingP2ptradeTarget) then {((EPOCH_pendingP2ptradeTarget isKindOf 'Man') && (dyna_cursorTarget isEqualTo EPOCH_pendingP2ptradeTarget))} else {false}"; dyna_locked = "locked dyna_cursorTarget in [2,3]"; dyna_lockedInVehicle = "locked vehicle player in [2,3]"; diff --git a/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp b/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp index 34bf00c0..2f5f6256 100644 --- a/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp +++ b/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp @@ -79,7 +79,7 @@ class tra_shop class player_takeCrypto { - condition = "dyna_isDeadPlayer && (dyna_cursorTarget getVariable ['Crypto',0]) > 0"; + condition = "dyna_isDeadPlayer"; action = "dyna_cursorTarget call EPOCH_takeCrypto;"; icon = "x\addons\a3_epoch_code\Data\UI\buttons\krypto.paa"; tooltip = "Take Krypto";