Open
Conversation
blackfisch
suggested changes
Mar 26, 2020
Contributor
blackfisch
left a comment
There was a problem hiding this comment.
Looks mostly good, however there's some things bothering me :D
You make me do work, I'll make you work!
Casperento
reviewed
May 4, 2020
blackfisch
suggested changes
Dec 27, 2021
blackfisch
suggested changes
Dec 28, 2021
|
|
||
| [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() |
Contributor
There was a problem hiding this comment.
Use a separate statement.
Suggested change
| 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() |
| */ | ||
| private ["_type","_varName","_displayName","_sideFlag","_price"]; | ||
| _type = _this select 3; | ||
| params ["", "", "", "_type"]; |
Contributor
There was a problem hiding this comment.
use extended syntax for type safety:
Suggested change
| 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; |
Contributor
There was a problem hiding this comment.
Suggested change
| private _vehicle = vehicle player; | |
| private _vehicle = objectParent player; |
would be the nicer way. might have to check for isNull _vehicle tho
| } count _resourceZones; | ||
|
|
||
| if (_zone != "") exitWith {}; | ||
| if !(_zone isEqualTo "") exitWith {}; |
Contributor
There was a problem hiding this comment.
use new isNotEqualTo command
|
|
||
| if (_requiredItem != "") then { | ||
| _valItem = missionNamespace getVariable "life_inv_" + _requiredItem; | ||
| if !(_requiredItem isEqualTo "") then { |
Contributor
There was a problem hiding this comment.
use new isNotEqualTo command
| } count (assignedItems player); | ||
|
|
||
| if (hmd player != "") then { | ||
| if !(hmd player isEqualTo "") then { |
Contributor
There was a problem hiding this comment.
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 { |
Contributor
There was a problem hiding this comment.
use new isNotEqualTo command
| }; | ||
|
|
||
| private _textureArray = M_CONFIG(getArray,"LifeCfgVehicles",_className,"textures"); | ||
| private _colorIndex = _textureArray findIf {_x select 0 == _colorName}; |
| ]; | ||
|
|
||
| //Error checks | ||
| if (isNull _vehicle || isNull _unit) exitWith { |
Contributor
There was a problem hiding this comment.
Suggested change
| if (isNull _vehicle || isNull _unit) exitWith { | |
| if (isNull _vehicle || {isNull _unit}) exitWith { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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