//=====================================================================
// NemesisWINGSvX.
//      ""(§)FrÅgÊd(§)""
//               **Monarch**
//
//              555 ---===CrAzYBoNeS===--- 555
//			Boppolis_The_Dog
//
//
// Thank you Al McElrath for SLV2.
//=====================================================================
class SLMutator extends Mutator;

var PlayerPawn ho;					// HUD owner.


function postBeginPlay() {
	ho = PlayerPawn(owner);
	register();
}


/** This checks to make sure we're in the HUD mutator list. If we
	reach any Relic HUD mutators before us, just put us at the front. The
	Relic HUD mutators don't allow non-Relic HUD mutators below them.
*/
function register() {
	local Mutator m;
	local bool move;

    if ( ho == none )
    return;

	m = ho.myHUD.HUDMutator;

	if (m == self)
		return;

	if (m != none) {
		while (getNext(m) != none) {
			if (isRelic(getNext(m)))
				// We're lost. Put us at the front.
				break;

			if (getNext(m) == self)
				// We're in there. Return.
				return;

			/*
			setNext(m, getNext(getNext(m)));
			self.nextHUDMutator = none;
			break;
			*/

			m = getNext(m);
		}
	}

	// Put it in front.
	nextHUDMutator = ho.myHUD.HUDMutator;
	ho.myHUD.HUDMutator = self;
}


function bool isRelic(Mutator m) {
	return (m.isA('HUDMutator'));
}


function Mutator getNext(Mutator m) {
	if (m.isA('HUDMutator'))
//		return HUDMutator(m).nextRHUDMutator;
		return m.nextHUDMutator;
	else
		return m.nextHUDMutator;
}


/* Not used.
function Mutator setNext(Mutator m, Mutator n) {
	if (m.isA('HUDMutator'))
		// So stupid. HUDMutator(anything) returns none unless it's a relic.
		HUDMutator(m).nextRHUDMutator = HUDMutator(n);
	else
		m.nextHUDMutator = n;
}
*/

// end

defaultproperties
{
}
