Page 1 of 1

Bug with deities/deity[#n] when an item is usable by tunare

Posted: Wed Jan 17, 2018 12:07 am
by plure
on line 6864 the code in MQ2DataTypes.cpp:

Code: Select all

case Deities:
        Dest.DWord = 0;
        // count bits
        cmp = GetItemFromContents(pItem)->Diety;
        for (N = 0; N < 15; N++)
        {
            if (cmp&(1 << N))
                Dest.DWord++;
        }
        Dest.Type = pIntType;
        return true;
    case Deity:
        if (ISINDEX())
        {
            if (ISNUMBER())
            {
                DWORD Count = GETNUMBER();
                if (!Count)
                    return false;
                cmp = GetItemFromContents(pItem)->Diety;
                for (N = 0; N < 15; N++)
                {
                    if (cmp&(1 << N))
                    {
                        Count--;
                        if (Count == 0)
                        {
                            Dest.DWord = N + 200;
                            Dest.Type = pDeityType;
                            return true;
                        }
                    }
                }
            }
            else
            {
                // by name
                cmp = GetItemFromContents(pItem)->Diety;
                for (N = 0; N < 16; N++) {
                    if (cmp&(1 << N)) {
                        if (!_stricmp(GETFIRST(), pEverQuest->GetDeityDesc(N + 200))) {
                            Dest.DWord = N + 200;
                            Dest.Type = pDeityType;
                            return true;
                        }
                    }
                }
                return false;
            }
        }
        return false;
needs to be changed to:

Code: Select all

	case Deities:
		Dest.DWord = 0;
		// count bits
		cmp = GetItemFromContents(pItem)->Diety;
		for (N = 0; N < 16; N++)
		{
			if (cmp&(1 << N))
				Dest.DWord++;
		}
		Dest.Type = pIntType;
		return true;
	case Deity:
		if (ISINDEX())
		{
			if (ISNUMBER())
			{
				DWORD Count = GETNUMBER();
				if (!Count)
					return false;
				cmp = GetItemFromContents(pItem)->Diety;
				for (N = 0; N < 16; N++)
				{
					if (cmp&(1 << N))
					{
						Count--;
						if (Count == 0)
						{
							Dest.DWord = N + 200;
							Dest.Type = pDeityType;
							return true;
						}
					}
				}
			}
			else
			{
				// by name
				cmp = GetItemFromContents(pItem)->Diety;
				for (N = 0; N < 16; N++) {
					if (cmp&(1 << N)) {
						if (!_stricmp(GETFIRST(), pEverQuest->GetDeityDesc(N + 200))) {
							Dest.DWord = N + 200;
							Dest.Type = pDeityType;
							return true;
						}
					}
				}
				return false;
			}
		}
		return false;
Tunare is the last deity and was getting missed.

Re: Bug with deities/deity[#n] when an item is usable by tunare

Posted: Wed Jan 17, 2018 1:48 am
by SwiftyMUSE
I've sent the merged code to EqMule for next zip (hopefully tomorrow's patch).