Remove public variable event handler when using config traders. (#1930)

* Remove public variable event handler when using config traders.

This stops the public variable event handler from being loaded when
you're using config based traders, it's not needed in this situation

* Change nearestObjects to nearEntities in z_checkCloseVehicle.sqf

* Fixes vehicle selling not able to sell correctly

If more than 1 vehicle of the same classname was in a trader and the
local vehicle was further away it would not be able to be sold till
moved closer. We are using DZE_myVehicle for everything and we do
previous checks to make sure it's not null and local so we can assume it
is okay to use.

Fixes
https://epochmod.com/forum/topic/43643-vehicle-dze4-can-not-be-sell/#comment-290036
This commit is contained in:
oiad
2017-04-02 05:02:51 +12:00
committed by ebayShopper
parent 7d6651b1fe
commit 088945e074
4 changed files with 17 additions and 19 deletions

View File

@@ -97,7 +97,9 @@ if (isServer) then {
"PVDZE_veh_Publish2" addPublicVariableEventHandler {(_this select 1) spawn server_publishVeh2}; //Used to purchase vehicles at traders
"PVDZE_veh_Upgrade" addPublicVariableEventHandler {(_this select 1) spawn server_publishVeh3}; //Used for car upgrades
"PVDZE_obj_Trade" addPublicVariableEventHandler {(_this select 1) spawn server_tradeObj};
"PVDZE_plr_TradeMenu" addPublicVariableEventHandler {(_this select 1) spawn server_traders};
if (!DZE_ConfigTrader) then {
"PVDZE_plr_TradeMenu" addPublicVariableEventHandler {(_this select 1) spawn server_traders};
};
"PVDZE_plr_DeathB" addPublicVariableEventHandler {(_this select 1) spawn server_deaths};
"PVDZE_handleSafeGear" addPublicVariableEventHandler {(_this select 1) spawn server_handleSafeGear};
if (dayz_groupSystem) then {