Skip to content

Commit

Permalink
fixing stock not correctly behaving (double terminal buy possible)
Browse files Browse the repository at this point in the history
  • Loading branch information
nomisum committed Jan 21, 2019
1 parent e52b3ca commit 71a0242
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
4 changes: 3 additions & 1 deletion BC_buymenu/functions/fn_changeValue.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private _valueTotalSideCount = _parentControl getVariable ["valueTotalSideCount"

private _catValue = _ctrlChosenInThisCat getVariable ["value", 0];
private _maxValue = _ctrlChosenInThisCat getVariable ["maxValue", 0];
private _stock = _ctrlChosenInThisCat getVariable ["stock", 0];
private _stock = _parentControl getVariable ["stock", 0];

private _crewCount = _parentControl getVariable ["crew", 0];
private _cargoCount = _parentControl getVariable ["cargo", 0];
Expand Down Expand Up @@ -51,6 +51,8 @@ if (_increaseValue) then {
_catValue = _catValue - 1;
};

private _itemConfigName = _data param [2, ""];
diag_log format ["_item is %1, _value %2, _stock is %3", _itemConfigName, _itemValue, _stock];
////// LIMITER
// dont allow going above max value
if (_itemValue == _maxItemValue || _itemValue >= _stock) then {
Expand Down
2 changes: 1 addition & 1 deletion BC_buymenu/functions/fn_getVehicleParams.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private _stock = [(_itemConfig >> "stock"), "number", 999999] call CBA_fnc_getCo
private _description = [(_itemConfig >> "description"), "text", [_itemConfigName] call grad_lbm_fnc_getDescription] call CBA_fnc_getConfigEntry;
private _code = compile ([(_itemConfig >> "code"), "text", ""] call CBA_fnc_getConfigEntry);

// diag_log format ["_displayName %1", _displayName];
diag_log format ["reading _stock %1", _stock];

private _picturePath = [(_itemConfig >> "picturePath"), "text", ""] call CBA_fnc_getConfigEntry;
if (_picturePath isEqualTo "") then {
Expand Down
2 changes: 1 addition & 1 deletion BC_setup/functions/client/fn_teleportPlayer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ params ["_position", "_distance"];
cutText ["", "BLACK OUT", 0.1];
if (str player != "opfor_teamlead") then { sleep (random 7);};

private _emptyPosition = _position findEmptyPosition[10, _distance, "B_Soldier_F"];
private _emptyPosition = _position findEmptyPosition [15, _distance, "B_Soldier_F"];
diag_log format ["teleporting %1 to %2.", player, _emptyPosition];

sleep 1;
Expand Down
10 changes: 5 additions & 5 deletions mission.sqm
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ class EditorData
toggles=1;
class ItemIDProvider
{
nextID=1355;
nextID=1356;
};
class MarkerIDProvider
{
nextID=16;
};
class Camera
{
pos[]={1600.5537,33.294987,5276.7852};
dir[]={0.4062908,-0.29414397,0.86525154};
up[]={0.12506503,0.95571905,0.26634428};
aside[]={0.90528005,-2.1953601e-006,-0.42509413};
pos[]={1628.0424,33.294987,5147.5068};
dir[]={-0.91015166,-0.37969366,0.16646701};
up[]={-0.37358177,0.92506552,0.068327829};
aside[]={0.17994408,-1.5264377e-006,0.98379731};
};
};
binarizationWanted=0;
Expand Down

0 comments on commit 71a0242

Please sign in to comment.