1342 {
1343 int muzzleIndex = wpn.GetCurrentMuzzle();
1344 Magazine old_mag = Magazine.Cast(wpn.GetMagazine(muzzleIndex));
1345 InventoryLocation temp = new InventoryLocation();
1346
1347 if (old_mag)
1348 {
1349 bool result = GameInventory.CanSwapEntitiesEx(new_mag, old_mag);
1350 if ( result )
1351 {
1352 new_mag.GetInventory().GetCurrentInventoryLocation(new_il);
1353 new_il.SetItem(old_mag);
1354 }
1355 else
1356 {
1357 result = GameInventory.CanForceSwapEntitiesEx(new_mag, null, old_mag, new_il);
1358 float dir[4];
1359 if ( !result )
1360 {
1361 new_il.SetGroundEx( old_mag,
m_player.GetPosition(), dir);
1362 }
1363 }
1364 }
1365 return true;
1366 }