Page MenuHomeFeedback Tracker

Cargo Scripting Commands for alive / destroyed Vehicles do not match
Closed, ResolvedPublic

Description

I have noticed, that destroyed Vehicles and alive Vehicles give back different values for their Inventory:

Alive Vehicles:

  • WeaponsItemsCargo _vehicle -> ok
  • MagazinesAmmoCargo _vehicle -> ok
  • GetBackPackCargo _vehicle -> ok
  • GetItemCargo _vehicle -> ok
  • EveryContainer _ vehicles -> ok

Destroyed Vehicles:

  • WeaponsItemsCargo _vehicle -> ok
  • MagazinesAmmoCargo _vehicle -> ok
  • GetBackPackCargo _vehicle -> empty Array
  • GetItemCargo _vehicle -> empty Array
  • EveryContainer _ vehicles -> ok

I am a bit confused, that only 2 of these 5 commands give empty arrays on destroyed Vehicles.
Maybe it is intended, but maybe not?!

Details

Severity
Feature
Resolution
Won't Fix
Reproducibility
Always
Operating System
Windows 10 x64
Category
Scripting
Steps To Reproduce

Put some items into a Vehicle and check the above commands.
Then destroy the vehicle and check these commands again.

Event Timeline

He-Man created this task.Nov 15 2019, 9:10 PM
BIS_fnc_KK added a subscriber: BIS_fnc_KK.EditedNov 24 2019, 4:32 PM

It is what it is. If you would like to have unified return for every command make sure you clear inventory when entity dies, for example:

if (isServer) then
{
	addMissionEventHandler ["EntityKilled",
	{
		params ["_entity"];
		
		clearMagazineCargoGlobal _entity; 
		clearWeaponCargoGlobal _entity; 
		clearItemCargoGlobal _entity;
		clearBackpackCargoGlobal _entity;
		
		{ _entity deleteVehicleCrew _x } forEach crew _entity;
	}];
};
BIS_fnc_KK closed this task as Resolved.Nov 24 2019, 4:33 PM
BIS_fnc_KK changed Resolution from Open to Won't Fix.

This is not a fix, but a workaround (for some cases).
I was trying to get the inventory from destroyed Vehicles into a variable.
In case Bugfixes are low prio, then its okay. Just want to help fixing things

BIS_fnc_KK added a comment.EditedDec 24 2019, 8:21 PM

It is not a fix, it is a won’t fix

Resolution
Won't Fix

Meaning that it is too risky to change command functionality at this point so it won’t be changed