Page MenuHomeFeedback Tracker

Take eventhandler unexpected behaviour
Closed, ResolvedPublic

Description

Reloading a weapon or adding a magazine to a weapon with addPrimaryWeaponItem/addSecondaryWeaponItem/addHandgunItem triggers the Take event.
Adding attachments does not trigger the event, it's only the magazines.

In contrast the Put event does not trigger when removing primary/secondary/handgun magazine

Details

Severity
None
Resolution
Not Fixable
Reproducibility
Always
Operating System
Windows 10 x64
Category
Engine
Steps To Reproduce
  1. play as soldier
  2. add Take event: player addEventHandler ["Take", {hint str _this}]
  3. Reload current weapon
  4. Take event triggered, as if it was Reloaded event
  5. add a magazine to weapon with player addPrimaryWeaponItem (primaryWeaponMagazine player # 0)
  6. Take event triggered
Additional Information

This would be a nice start for a loadoutChanged event, so hintC 'please add loadoutChanged event, returning [_unit, _newloadout, _oldloadout, _item, _added/removed]'.. ;)

Event Timeline

h- created this task.Jun 1 2020, 8:14 PM

When unit reloads it takes current magazine and puts it in uniform or vest or backpack and takes another magazine from those containers, so the magazine changes and the action of putting or getting a mag from a container triggers the EH. Granted that the firing on addprimaryweaponitem is a bit odd, however at this point we are not going to touch it as it could introduce unexpected behaviour and break existing functionality in scripts. AFAIK no tweaks have been done to these EHs for a long long time.

BIS_fnc_KK closed this task as Resolved.Jun 3 2020, 11:06 PM
BIS_fnc_KK changed Resolution from Open to Not Fixable.