Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fn_vehiclePrice to not fail on absent vehicles. #3228

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions A3A/addons/core/functions/REINF/fn_vehiclePrice.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,21 @@ FIX_LINE_NUMBERS()

params ["_typeX"];

private _costs = server getVariable _typeX;
_costs = 0;
ante185 marked this conversation as resolved.
Show resolved Hide resolved

if (isNil "_typeX") then
{
Error_1("Vehicle does not exist.");
_costs = 0;
}
else
{
_costs = server getVariable _typeX;
};

if (isNil "_costs") then
{
Error_1("Invalid vehicle price :%1.", _typeX);
Error_1("Invalid vehicle price :%1.", _typeX);
_costs = 0;
}
else
ante185 marked this conversation as resolved.
Show resolved Hide resolved
Expand Down