It was apparently possible to fire off the drop item action twice under some real circumstances, which causes script errors. There may also have been ways to dodge some of the carry checks under similar load. This PR hardens the carry & drop actions so that they're hopefully proofed against script load issues.
Note that the github diff is a mess because the indentation changed. Actual changes are just adding sanity checks at the front of each function and wrapping the rest in isNil { code } to make sure it's not interrupted.
Edit: I suspect the reported issue was actually caused by dropItem taking a scheduler break between the detach and the A3A_carryingItem reset, which then causes the spawn in carryItem to trigger a second dropItem. The changes should fix that too anyway.
Please specify which Issue this PR Resolves.
closes #XXXX
Please verify the following and ensure all checks are completed.
[X] Have you loaded the mission in LAN host?
[X] Have you loaded the mission on a dedicated server?
Is further testing or are further changes required?
[X] No
[ ] Yes (Please provide further detail below.)
How can the changes be tested?
You can generate massive script load with something like this:
for "_i" from 1 to 100 do {
0 spawn {
while {isNil "test_stopSpam"} do {
player nearRoads 100;
};
};
};
This should delay the addActions enough that you can fire them multiple times. Should work correctly now.
What type of PR is this.
What have you changed and why?
It was apparently possible to fire off the drop item action twice under some real circumstances, which causes script errors. There may also have been ways to dodge some of the carry checks under similar load. This PR hardens the carry & drop actions so that they're hopefully proofed against script load issues.
Note that the github diff is a mess because the indentation changed. Actual changes are just adding sanity checks at the front of each function and wrapping the rest in isNil { code } to make sure it's not interrupted.
Edit: I suspect the reported issue was actually caused by dropItem taking a scheduler break between the detach and the A3A_carryingItem reset, which then causes the spawn in carryItem to trigger a second dropItem. The changes should fix that too anyway.
Please specify which Issue this PR Resolves.
closes #XXXX
Please verify the following and ensure all checks are completed.
Is further testing or are further changes required?
How can the changes be tested?
You can generate massive script load with something like this:
This should delay the addActions enough that you can fire them multiple times. Should work correctly now.