Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Switch on type of loot
- switch (_lootInfo select 0) do
- {
- //Spawn a single weapon with [0,MAX_WEAPON_MAGAZINES] magazines.
- case Loot_WEAPON:
- {
- _vehicle = createVehicle ["WeaponHolder", _this select 1, [], 0, "CAN_COLLIDE"];
- _vehicle addWeaponCargoGlobal [_lootInfo select 1, 1];
- Debug_Assert(typeName (_lootInfo select 1) == typeName "" && { (_lootInfo select 1) != "" });
- //Debug_Log(String_Format2("DEBUG: Loot_Spawn Weapon: %1 Position: %2", _lootInfo select 1, _this select 1));
- if (surfaceIsWater (_this select 1)) then {
- _vehicle setPos (_this select 1);
- } else {
- _vehicle setPosATL (_this select 1);
- };
- INCREMENT_WEAPON_HOLDERS();
- _magazines = getArray (configFile >> "CfgWeapons" >> _lootInfo select 1 >> "magazines");
- if (count _magazines > 0 && {getNumber (configFile >> "CfgWeapons" >> _lootInfo select 1 >> "melee") != 1}) then
- {
- #ifdef COMPLEX_WEAPON_MAGAZINES
- for "_i" from 1 to (floor random (MAX_WEAPON_MAGAZINES + 1)) do
- {
- _vehicle addMagazineCargoGlobal [_magazines select floor random count _magazines, 1];
- };
- #else
- _vehicle addMagazineCargoGlobal [_magazines select 0, floor random (MAX_WEAPON_MAGAZINES + 1)];
- #endif
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement