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.Fri, Nov 15, 9:10 PM
BIS_fnc_KK added a subscriber: BIS_fnc_KK.EditedSun, Nov 24, 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.Sun, Nov 24, 4:33 PM
BIS_fnc_KK changed Resolution from Open to Won't Fix.