Fix magnetized items being blocked by "monster block" lines.

This commit is contained in:
Mari the Deer 2022-12-30 23:16:16 +01:00
commit f3946f832b
3 changed files with 8 additions and 4 deletions

View file

@ -13,7 +13,7 @@ Class SWWMMagItem play
if ( !item || item.Owner || !item.bSPECIAL || item.bINVISIBLE || !SWWMUtility.SphereIntersect(target,item.pos,800) || !target.CheckSight(item,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) return true;
Class<Inventory> cls = item.GetClass();
if ( item is 'Ammo' ) cls = Ammo(item).GetParentAmmo();
else if ( item is 'MaGammo' ) cls = MagAmmo(item).GetParentMagAmmo();
else if ( item is 'MagAmmo' ) cls = MagAmmo(item).GetParentMagAmmo();
let oi = target.FindInventory(cls);
if ( !item.bALWAYSPICKUP && oi && (oi.Amount >= oi.MaxAmount) ) return true;
if ( (item is 'SWWMWeapon') && SWWMWeapon(item).HasSwapWeapon(target) && swwm_swapweapons ) return true;
@ -39,6 +39,8 @@ Class SWWMMagItem play
if ( !item ) return;
if ( item.bSPECIAL ) item.bNOGRAVITY = item.default.bNOGRAVITY;
item.bDROPOFF = item.default.bDROPOFF;
item.bSLIDESONWALLS = item.default.bSLIDESONWALLS;
item.bNOBLOCKMONST = item.default.bNOBLOCKMONST;
item.A_StopSound(CHAN_AMBEXTRA);
}
}

View file

@ -81,7 +81,9 @@ extend Class Demolitionist
nmi.next = magitem;
i.A_StartSound("misc/magitem",CHAN_AMBEXTRA,CHANF_LOOP,.2,1.,.5);
i.bNOGRAVITY = true;
i.bDROPOFF = true; // required so items can cross over certain lines
i.bDROPOFF = true;
i.bSLIDESONWALLS = true;
i.bNOBLOCKMONST = true;
magitem = nmi;
magitem_cnt++;
}