Files
DayZ-Epoch/SQF/dayz_code/actions/show_dialog.sqf
ebaydayz 7151f6859f Fix trader menu expected array error
TraderItemList and TraderCatList should be initialized as arrays, not numbers. Fixes this error:
```
Error in expression < 0;
if (_index < 0) exitWith {};
while {count TraderItemList < 1} do { sleep 1; >
  Error position: <count TraderItemList < 1} do { sleep 1; >
  Error count: Type Number, expected Array,Config entry
File z\addons\dayz_code\compile\player_traderMenuHive.sqf, line 174
```
See: https://github.com/vbawol/DayZ-Epoch/issues/1616

Tested buying and selling to all the stary and base traders as well as the boat dealer with these changes. No more error or problems.
2015-02-04 14:13:08 -05:00

25 lines
571 B
Plaintext

private ["_trader_data", "_dialog"];
if (DZE_ActionInProgress) exitWith {
cutText [(localize "str_epoch_player_97") , "PLAIN DOWN"];
};
_trader_data = (_this select 3);
_dialog = createdialog "TraderDialog";
lbClear TraderDialogCatList;
lbClear TraderDialogItemList;
TraderCurrentCatIndex = -1;
TraderItemList = [];
TraderCatList = [];
{
private ["_index", "_x"];
_index = lbAdd [TraderDialogCatList, _x select 0];
TraderCatList set [count TraderCatList, _x select 1];
} count _trader_data;
waitUntil { !dialog };
TraderCurrentCatIndex = -1;
TraderCatList = [];