Reset weapon pickup voicelines only when inventory is wiped.

This commit is contained in:
Mari the Deer 2023-11-27 15:44:23 +01:00
commit 6a6c26f307
5 changed files with 31 additions and 23 deletions

View file

@ -100,27 +100,8 @@ extend Class SWWMHandler
s.GotWeapon(Weapon(i).GetClass());
}
}
else if ( (s.lastcluster != level.cluster) || !(level.clusterflags&LevelLocals.CLUSTER_HUB) || (level.info.flags2&LEVEL2_RESETINVENTORY && !e.IsReturn) )
{
// clear the "weapon got" lists for weapons we don't have anymore (unless we're in a hub)
// so the obtain lines play again
for ( int i=0; i<s.alreadygot.Size(); i++ )
{
// special case for dual weapons
String cn = s.alreadygot[i].GetClassName();
if ( (cn.Left(4) ~== "Dual") )
{
int ss = p.mo.CountInv(GetDefaultByType(s.alreadygot[i]).SisterWeaponType);
if ( ss == 2 ) continue;
s.alreadygot.Delete(i);
i--;
continue;
}
if ( p.mo.FindInventory(s.alreadygot[i]) ) continue;
s.alreadygot.Delete(i);
i--;
}
}
else if ( level.info.flags2&LEVEL2_RESETINVENTORY && !e.IsReturn )
s.CleanGotWeapons(); // clean up the "got weapons" so their obtain lines are played again
// reset some vars
multilevel[e.playernumber] = 0;
spreecount[e.playernumber] = 0;