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