-
Notifications
You must be signed in to change notification settings - Fork 740
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
Linkingbelt refactoring #5213
Linkingbelt refactoring #5213
Conversation
startLinking belt now uses canLinkBelt so if condition needs to be changed then you can do it on one position.
Fixed requested change
canLinkBelt now returns a value over 0 if success and -1 if something is not right.
Fixed bug where if error we would not exit
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.
I would probably be inclined to rename the canLinkBelt
function since its purpose has changed to returning the max ammo
addons/reload/CfgVehicles.hpp
Outdated
@@ -6,7 +6,7 @@ class CfgVehicles { | |||
class GVAR(LinkBelt) { | |||
displayName = CSTRING(LinkBelt); | |||
distance = 2.0; | |||
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canLinkBelt)); | |||
condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canLinkBelt) > 0)); |
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.
Is this meant to be:
QUOTE(([ARR_2(_player, _target)] call FUNC(canLinkBelt)) > 0)
Otherwise the extra set of brackets aren't doing anything 😛
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.
Yes. Woops little to fast maybe.
Was thinking about it but it was to far of a leap 😛
Fnc_maxAmmiLinkBelt? Help me.
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.
maybe getAmmoToLink?
Changed name to better reflect the function of the function.
Fixed! |
* Check if the target has an MG equiped with belt system that the player can link | ||
* | ||
* Arguments: | ||
* 0: Player <OBJECT> | ||
* 1: Target <OBJECT> | ||
* | ||
* Return Value: | ||
* Can link belt<BOOL> | ||
* MaxAmmo magazine <INT> |
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.
Maximum ammo of magazine (-1 on error)
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.
Fixed. Thank you!
fixed return value info
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.
Fixed jonpas comment
… into Phyma-linkingbelt-refactoring
Removed redundant code fnc_canLinkBelt now returns a value over 0 if success and -1 if error.
This is so there is no equal code in canLinkBelt and startLinkBelt.
Changes to config so it works.
When merged this pull request will: