mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-15 13:26:39 +03:00
Optimize save after trade
See my comment on b806043
Veh_setFixServer only runs on the server, so the client does not need to
compile it.
The PVDZ_veh_Save PVEH is only added on the server, so it should never
be sent with regular publicVariable anymore.
This commit is contained in:
@@ -259,6 +259,11 @@ if (_enoughMoney) then {
|
||||
};
|
||||
};
|
||||
_itemsToLog call Z_logTrade;
|
||||
call player_forceSave;
|
||||
if (Z_SellingFrom == 1) then {
|
||||
PVDZ_veh_Save = [Z_vehicle,"gear"];
|
||||
publicVariableServer "PVDZ_veh_Save";
|
||||
};
|
||||
} else {
|
||||
if (Z_SingleCurrency) then {
|
||||
systemChat format[localize "STR_EPOCH_TRADE_NEED_COINS",[_priceToBuy] call BIS_fnc_numberText,CurrencyName];
|
||||
|
||||
@@ -260,6 +260,8 @@ if (_return_change > 0) then {
|
||||
} else {
|
||||
_successful = true;
|
||||
};
|
||||
|
||||
if (_combine) then {call player_forceSave;};
|
||||
};
|
||||
|
||||
if (Z_ChangeInBackpack) then { systemChat localize "STR_EPOCH_TRADE_CHANGE_IN_BACKPACK"; };
|
||||
|
||||
@@ -161,7 +161,6 @@ if (Z_SellingFrom == 2) then {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
} forEach Z_SellArray;
|
||||
|
||||
_outcome set [0,_mA];
|
||||
@@ -231,6 +230,11 @@ if (typeName _money == "SCALAR") then {
|
||||
if (_tCost != "") then { systemChat format[localize "STR_EPOCH_TRADE_SELL_SUCCESS",_tCost]; };
|
||||
};
|
||||
_itemsToLog call Z_logTrade;
|
||||
call player_forceSave;
|
||||
if (Z_SellingFrom == 1) then {
|
||||
PVDZ_veh_Save = [Z_vehicle,"gear"];
|
||||
publicVariableServer "PVDZ_veh_Save";
|
||||
};
|
||||
} else {
|
||||
systemChat localize "STR_EPOCH_TRADE_DEBUG";
|
||||
diag_log "Money is not a number. Something went wrong.";
|
||||
|
||||
Reference in New Issue
Block a user