-
Notifications
You must be signed in to change notification settings - Fork 737
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
Vehicle Lock - Enable for planes #6646
Conversation
@@ -33,4 +33,9 @@ class Extended_InitPost_EventHandlers { | |||
serverInit = QUOTE(_this call FUNC(handleVehicleInitPost)); | |||
}; | |||
}; | |||
class Plane { | |||
class ADDON { | |||
serverInit = QUOTE(_this call FUNC(handleVehicleInitPost)); |
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.
QFUNC(handleVehicleInitPost)
?
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.
Why? You can't call a string
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.
That would break it, because it removes the call
.
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.
oops... too much time with CBA state machine
@@ -27,7 +27,7 @@ TRACE_1("params",_vehicle); | |||
|
|||
params ["_vehicle"]; | |||
|
|||
if ((_vehicle isKindOf "Car") || {_vehicle isKindOf "Tank"} || {_vehicle isKindOf "Helicopter"}) then { | |||
if (_vehicle isKindOf "Car" || {_vehicle isKindOf "Tank" || {_vehicle isKindOf "Helicopter" || {_vehicle isKindOf "Plane"}}}) 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.
Can't we combine them into IsKindOf Air?
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.
Yeah, although this is consistent with what we use everywhere else.
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 (_vehicle isKindOf "Car" || {_vehicle isKindOf "Tank" || {_vehicle isKindOf "Helicopter" || {_vehicle isKindOf "Plane"}}}) then { | |
if (-1 < ["Car", "Tank", "Helicopter", "Plane"] findIf {_vehicle isKindOf _x}) then { |
github suggestion is cool :)
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.
Like, except the -1 should be at the end and the < be a >.
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.
this whole line is pointless
func is only called from xeh added to specific vehicle types
https://github.com/acemod/ACE3/blob/master/addons/vehiclelock/CfgEventHandlers.hpp#L23
@@ -28,7 +28,7 @@ if !(_activated) exitWith {WARNING("Vehicle Lock Sync Module - placed but not ac | |||
params ["_syncedObjects"]; | |||
|
|||
private _listOfVehicles = _syncedObjects select { | |||
(_x isKindOf "Car") || {(_x isKindOf "Tank") || {_x isKindOf "Helicopter"}} | |||
_x isKindOf "Car" || {_x isKindOf "Tank" || {_x isKindOf "Helicopter" || {_x isKindOf "Plane"}}} |
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.
_x isKindOf "Car" || {_x isKindOf "Tank" || {_x isKindOf "Helicopter" || {_x isKindOf "Plane"}}} | |
private _vehicle = _x; | |
-1 < ["Car", "Tank", "Helicopter", "Plane"] findIf {_vehicle isKindOf _x} |
Also I think this array of classes should become macro because it's used at least in 2 places.
@@ -28,7 +28,8 @@ if !(_activated) exitWith {WARNING("Vehicle Lock Sync Module - placed but not ac | |||
params ["_syncedObjects"]; | |||
|
|||
private _listOfVehicles = _syncedObjects select { | |||
(_x isKindOf "Car") || {(_x isKindOf "Tank") || {_x isKindOf "Helicopter"}} | |||
#define CLASSNAMES ["Car", "Tank", "Air"] |
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.
macro is useless here
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.
Commas break the args in a macro, because the preprocessor cannot handle the parentheses syntax. You'd have to use the ARR_3 macro which is ugly.
@@ -28,7 +28,8 @@ if !(_activated) exitWith {WARNING("Vehicle Lock Sync Module - placed but not ac | |||
params ["_syncedObjects"]; | |||
|
|||
private _listOfVehicles = _syncedObjects select { | |||
(_x isKindOf "Car") || {(_x isKindOf "Tank") || {_x isKindOf "Helicopter"}} | |||
#define CLASSNAMES ["Car", "Tank", "Air"] | |||
IS_KIND_OF_ANY(_x,CLASSNAMES) |
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.
you now have findIf {(_x) isKindOf _x}
after preprocessing
* enable vehicle lock module for planes * Add actions to planes * improved lazy eval * remove superfluous parent class check * IS_KIND_OF_ANY macro * Update addons/vehiclelock/functions/fnc_moduleSync.sqf * Improve handleVehicleInitPost XEH
When merged this pull request will: