-
Notifications
You must be signed in to change notification settings - Fork 736
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
Rearm - Limited Supply (Fix Merge Conflcits) #5182
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
2795416
Expanded module and string table
GitHawk 91c6341
Implementation
GitHawk 8b87f1b
Custom width displayTextStructured
GitHawk 734c8b1
Minor fix
GitHawk 3d7c51b
Cleanup
GitHawk 3e2b01a
Another minor fix
GitHawk 8e6b4f4
More docu fixes
GitHawk 349b05a
Removed forgotten diag_log
GitHawk 6cce749
Merge acemod/master 3.5.0
GitHawk 8dc99a4
Replacing execRemoteFnc with events
GitHawk 29cd940
Added server events
GitHawk d050983
Some things
GitHawk a2b9678
Object event
GitHawk ef4e232
Merge remote-tracking branch 'master' into rearm_supply
GitHawk 9cfa2f1
Stuff
GitHawk bc90a85
Improvements
GitHawk e3f8fc2
Merge remote-tracking branch 'refs/remotes/acemod/master' into rearm_…
GitHawk 8e00474
Cleanup
GitHawk 46c041e
Merge branch 'rearm_supply' of https://github.com/GitHawk/ACE3 into G…
PabstMirror b192be0
Fix merge, cbaEvents, macros, cleanup
PabstMirror File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,38 @@ | ||
|
||
PREP(addMagazineToSupply); | ||
PREP(addRearmActions); | ||
PREP(addVehicleMagazinesToSupply); | ||
PREP(canReadSupplyCounter); | ||
PREP(canRearm); | ||
PREP(canRearmVehicle); | ||
PREP(canStoreAmmo); | ||
PREP(canTakeAmmo); | ||
PREP(createDummy); | ||
PREP(disable); | ||
PREP(dropAmmo); | ||
PREP(getCaliber); | ||
PREP(getConfigMagazines); | ||
PREP(getMaxMagazines); | ||
PREP(getNeedRearmMagazines); | ||
PREP(getSupplyCount); | ||
PREP(getVehicleMagazines); | ||
PREP(grabAmmo); | ||
PREP(handleKilled); | ||
PREP(handleUnconscious); | ||
PREP(hasEnoughSupply); | ||
PREP(magazineInSupply); | ||
PREP(makeDummy); | ||
PREP(moduleRearmSettings); | ||
PREP(pickUpAmmo); | ||
PREP(readSupplyCounter); | ||
PREP(rearm); | ||
PREP(rearmEntireVehicle); | ||
PREP(rearmEntireVehicleSuccess); | ||
PREP(rearmEntireVehicleSuccessLocal); | ||
PREP(rearmSuccess); | ||
PREP(rearmSuccessLocal); | ||
PREP(removeMagazineFromSupply); | ||
PREP(setSupplyCount); | ||
PREP(storeAmmo); | ||
PREP(takeAmmo); | ||
PREP(takeSuccess); |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Author: GitHawk | ||
* Adds magazines to the supply. | ||
* | ||
* Arguments: | ||
* 0: Ammo Truck <OBJECT> | ||
* 1: Magazine Classname <STRING> | ||
* 2: Only partial <BOOL>(optional) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Example: | ||
* [ammo_truck, "32Rnd_155mm_Mo_shells"] call ace_rearm_fnc_addMagazineToSupply | ||
* | ||
* Public: Yes | ||
*/ | ||
#include "script_component.hpp" | ||
|
||
params [ | ||
["_truck", objNull, [objNull]], | ||
["_magazineClass", "", [""]], | ||
["_partial", false, [false]] | ||
]; | ||
|
||
if (isNull _truck || | ||
{_magazineClass isEqualTo ""} || | ||
{GVAR(supply) == 0}) exitWith {}; | ||
|
||
([_magazineClass] call FUNC(getCaliber)) params ["_cal", "_idx"]; | ||
|
||
// With limited supply, we add the caliber to the supply count | ||
if (GVAR(supply) == 1) then { | ||
private _supply = [_truck] call FUNC(getSupplyCount); | ||
if (!_partial || {GVAR(level) == 1}) then { | ||
[_truck, _supply + _cal] call FUNC(setSupplyCount); | ||
} else { | ||
private _magazinePart = ((REARM_COUNT select _idx) / (getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "count"))) min 1; | ||
[_truck, (_supply + (_cal * _magazinePart))] call FUNC(setSupplyCount); | ||
}; | ||
}; | ||
|
||
// With magazine specific supply, we add or update the magazineSupply array | ||
if (GVAR(supply) == 2) then { | ||
private _magazineSupply = _truck getVariable [QGVAR(magazineSupply), []]; | ||
private _magazineIdx = -1; | ||
{ | ||
_x params ["_magazine", "_rounds"]; | ||
if ((_magazine isEqualTo _magazineClass)) exitWith { | ||
_magazineIdx = _forEachIndex; | ||
}; | ||
} forEach _magazineSupply; | ||
|
||
private _roundsPerTransaction = getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "count"); | ||
if (_partial) then { | ||
_roundsPerTransaction = _roundsPerTransaction min (REARM_COUNT select _idx); | ||
}; | ||
if (_magazineIdx == -1) then { | ||
if (count _magazineSupply == 0) then { | ||
_magazineSupply = [[_magazineClass, _roundsPerTransaction]]; | ||
} else { | ||
_magazineSupply append [[_magazineClass, _roundsPerTransaction]]; | ||
} | ||
} else { | ||
(_magazineSupply select _magazineIdx) params ["", "_rounds"]; | ||
_magazineSupply set [_magazineIdx, [_magazineClass, (_rounds + _roundsPerTransaction)]]; | ||
}; | ||
_truck setVariable [QGVAR(magazineSupply), _magazineSupply, true]; | ||
}; |
Oops, something went wrong.
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.
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.
(default: 10)