-
Notifications
You must be signed in to change notification settings - Fork 311
Major vehicle overhaul #640
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good, however there's some things bothering me :D
You make me do work, I'll make you work!
SQL1_INPUTS = 1, 2, 3 | ||
|
||
[insertVehicle] | ||
SQL1_1 = INSERT INTO vehicles (side, classname, type, pid, alive, active, inventory, color, plate, gear, damage) VALUES (?, ?, ?, ?, '1','1','[[],0]', ?, ?,'[]','[]') | ||
SQL1_1 = INSERT INTO vehicles (side, classname, type, pid, alive, active, inventory, color, plate, gear) VALUES (?, ?, ?, ?, '1','1','[[],0]', ?, ?,'[]'); SELECT LAST_INSERT_ID() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a separate statement.
SQL1_1 = INSERT INTO vehicles (side, classname, type, pid, alive, active, inventory, color, plate, gear) VALUES (?, ?, ?, ?, '1','1','[[],0]', ?, ?,'[]'); SELECT LAST_INSERT_ID() | |
SQL1_1 = INSERT INTO vehicles (side, classname, type, pid, alive, active, inventory, color, plate, gear) VALUES (?, ?, ?, ?, '1','1','[[],0]', ?, ?,'[]') | |
SQL1_2 = SELECT LAST_INSERT_ID() |
@@ -6,14 +6,13 @@ | |||
Description: | |||
Called when purchasing a license. May need to be revised. | |||
*/ | |||
private ["_type","_varName","_displayName","_sideFlag","_price"]; | |||
_type = _this select 3; | |||
params ["", "", "", "_type"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use extended syntax for type safety:
params ["", "", "", "_type"]; | |
params ["", "", "", ["_type", "", [""]]]; |
private ["_fish","_type","_typeName"]; | ||
if (!(vehicle player isKindOf "Ship")) exitWith {}; | ||
_fish = (nearestObjects[getPos vehicle player,["Fish_Base_F"],20]); | ||
private _vehicle = vehicle player; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private _vehicle = vehicle player; | |
private _vehicle = objectParent player; |
would be the nicer way. might have to check for isNull _vehicle
tho
|
||
if (_zone != "") exitWith {}; | ||
if !(_zone isEqualTo "") exitWith {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use new isNotEqualTo
command
}; | ||
|
||
if (_zone isEqualTo "") exitWith {life_action_inUse = false;}; | ||
|
||
if (_requiredItem != "") then { | ||
_valItem = missionNamespace getVariable "life_inv_" + _requiredItem; | ||
if !(_requiredItem isEqualTo "") then { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use new isNotEqualTo
command
|
||
if (hmd player != "") then { | ||
if !(hmd player isEqualTo "") then { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use new isNotEqualTo
command
private _owners = _vehicle getVariable "vehicle_info_owners"; | ||
private _insertedIndex = _owners pushBackUnique [_uid,_unit getVariable ["realname",name _unit]]; | ||
|
||
if (_insertedIndex != -1) then { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use new isNotEqualTo
command
}; | ||
|
||
private _textureArray = M_CONFIG(getArray,"LifeCfgVehicles",_className,"textures"); | ||
private _colorIndex = _textureArray findIf {_x select 0 == _colorName}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isEqualTo
|
||
//Error checks | ||
if (isNull _vehicle || isNull _unit) exitWith { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (isNull _vehicle || isNull _unit) exitWith { | |
if (isNull _vehicle || {isNull _unit}) exitWith { |
Resolves #528.
Changes proposed in this pull request:
Massive overhaul of the vehicle system including setting up for the built in plate system ArmA provides
Also completes actions that were done in Removed PVAR EVH and replaced with remoteExecutedOwner #498 prior to move to SQL Custom
I have tested my changes and corrected any errors found