More Awesome Than You!
Welcome, Guest. Please login or register.
2024 November 22, 00:30:43

Login with username, password and session length
Search:     Advanced search
540287 Posts in 18067 Topics by 6545 Members
Latest Member: cincinancy
* Home Help Search Login Register
  Show Posts
Pages: [1]
1  Awesomeware / AwesomeMod! / Re: Mailbox problems with AM installed on: 2013 March 19, 02:42:46
Hi, I was having this bug too and it was so annoying that I fixed it myself. It should be put in the folder 'Overrides' to override the original AwesomeMod file.

What I changed:
Code:
//Sims3.Gameplay.Core.Mailbox
//Old
private void PreReturnHome()
{
    GameStates.PreReturnHome -= new GameStates.TravelCallback(this.PreReturnHome);
    Sim activeActor = Sim.ActiveActor;
    List<IGameObject> list = base.Inventory.FindAll<IGameObject>(false);
    bool flag = (list.Count > 0) || (this.mInvisibleObjectList.Count > 0);
    foreach (GameObject obj2 in list)
    {
        if (base.Inventory.TryToRemove(obj2))
        {
            if (obj2 is AttractionGift)
            {
                IAmPutInMailbox mailbox = obj2 as IAmPutInMailbox;
                if (mailbox != null)
                {
                    mailbox.OnRemovalFromMailbox(activeActor);
                }
            }
            else
            {
                activeActor.Inventory.TryToAdd(obj2);
            }
        }
    }
    foreach (IGameObject obj3 in this.mInvisibleObjectList)
    {
        activeActor.Inventory.TryToAdd(obj3);
    }
    GameStates.ItemsAddedToTraveller = flag;
}

//New
private void PreReturnHome()
{
    GameStates.PreReturnHome -= new GameStates.TravelCallback(this.PreReturnHome);
    Sim activeActor = Sim.ActiveActor;
    List<IGameObject> list = base.Inventory.FindAll<IGameObject>(false);
    bool flag = (list.Count > 0) || (this.mInvisibleObjectList.Count > 0);
    foreach (GameObject obj2 in list)
    {
        IAmPutInMailbox mailbox = obj2 as IAmPutInMailbox;
        if (mailbox != null)
        {
            mailbox.OnRemovalFromMailbox(activeActor);
        }
        if ((base.Inventory.TryToRemove(obj2) && !(obj2 is AttractionGift)) && !(obj2 is LoveLetter))
        {
            activeActor.Inventory.TryToAdd(obj2);
        }
        if (mailbox != null)
        {
            mailbox.OnTransferComplete(activeActor);
        }
    }
    foreach (IGameObject obj3 in this.mInvisibleObjectList)
    {
        activeActor.Inventory.TryToAdd(obj3);
    }
    GameStates.ItemsAddedToTraveller = flag;
}
Code:
//Sims3.Gameplay.Core.Mailbox
//Old
private bool GrabMail(IActor a)
{
    bool flag = true;
    List<IAmPutInMailbox> list = new List<IAmPutInMailbox>();
    foreach (GameObject obj2 in base.Inventory.FindAll<IGameObject>(false))
    {
        IAmPutInMailbox item = obj2 as IAmPutInMailbox;
        if (item != null)
        {
            item.OnRemovalFromMailbox(a as Sim);
            list.Add(item);
        }
        if (base.Inventory.TryToRemove(obj2))
        {
            if (!a.Inventory.TryToAdd(obj2))
            {
                flag = false;
            }
        }
        else
        {
            flag = false;
        }
    }
    foreach (IAmPutInMailbox mailbox2 in list)
    {
        mailbox2.OnTransferComplete(a as Sim);
    }
    return flag;
}

//New
private bool GrabMail(IActor a)
{
    bool flag = true;
    foreach (GameObject obj2 in base.Inventory.FindAll<IGameObject>(false))
    {
        IAmPutInMailbox mailbox = obj2 as IAmPutInMailbox;
        if (mailbox != null)
        {
            mailbox.OnRemovalFromMailbox(a as Sim);
        }
        if (base.Inventory.TryToRemove(obj2))
        {
            if ((!(obj2 is AttractionGift) && !(obj2 is LoveLetter)) && !a.Inventory.TryToAdd(obj2))
            {
                flag = false;
            }
        }
        else
        {
            flag = false;
        }
        if (mailbox != null)
        {
            mailbox.OnTransferComplete(a as Sim);
        }
    }
    return flag;
}
Code:
//Sims3.Gameplay.Core.LoveLetter
//Old
public void OnRemovalFromMailbox(Sim actor)
{
    IMiniSimDescription iMiniSimDescription;
    IMiniSimDescription description2;
    TNSNames loveLetterSpontaneousNoRomanticState;
    if (this.IsResponse)
    {
        bool accepted = this.DecideAcceptReject(out iMiniSimDescription, out description2);
        loveLetterSpontaneousNoRomanticState = accepted ? TNSNames.LoveLetterResponseAccept : TNSNames.LoveLetterResponseReject;
        string name = accepted ? "sting_loveletter_accept" : "sting_loveletter_reject";
        Audio.StartObjectSound(actor.ObjectId, name, false);
        NotificationSystem.Show(loveLetterSpontaneousNoRomanticState, iMiniSimDescription.GetThumbnailKey(ThumbnailSize.Medium, 0), description2.GetThumbnailKey(ThumbnailSize.Medium, 0), null, null, new bool[] { iMiniSimDescription.IsFemale, description2.IsFemale }, false, null, new object[] { iMiniSimDescription, description2 });
        this.UpdateLTRAndRomanceVisibilityIfNeeded(actor, accepted);
    }
    else
    {
        iMiniSimDescription = SimDescription.GetIMiniSimDescription(this.ActorSimID);
        description2 = SimDescription.GetIMiniSimDescription(this.TargetSimID);
        IMiniRelationship miniRelationship = iMiniSimDescription.GetMiniRelationship(description2);
        if (miniRelationship != null)
        {
            if (miniRelationship.AreRomantic())
            {
                loveLetterSpontaneousNoRomanticState = (miniRelationship.CurrentLTRLiking >= kLTRForHighRomanceTNS) ? TNSNames.LoveLetterSpontaneousHighRomantic : TNSNames.LoveLetterSpontaneousMediumRomantic;
            }
            else
            {
                loveLetterSpontaneousNoRomanticState = TNSNames.LoveLetterSpontaneousNoRomanticState;
            }
            NotificationSystem.Show(loveLetterSpontaneousNoRomanticState, iMiniSimDescription.GetThumbnailKey(ThumbnailSize.Medium, 0), description2.GetThumbnailKey(ThumbnailSize.Medium, 0), null, null, new bool[] { iMiniSimDescription.IsFemale, description2.IsFemale }, false, null, new object[] { iMiniSimDescription, description2 });
        }
        SimDescription description3 = iMiniSimDescription as SimDescription;
        if (description3 != null)
        {
            Sim createdSim = description3.CreatedSim;
            if (createdSim != null)
            {
                EventTracker.SendEvent(new MiniSimDescriptionTargetEvent(EventTypeId.kGetLoveLetterFromSim, createdSim, description2));
            }
        }
    }
}

//New
public void OnRemovalFromMailbox(Sim actor)
{
    IMiniSimDescription actorMSD = null;
    IMiniSimDescription targetMSD = null;
    TNSNames loveLetterSpontaneousNoRomanticState;
    if (this.IsResponse)
    {
        bool accepted = this.DecideAcceptReject(out actorMSD, out targetMSD);
        if ((actorMSD != null) && (targetMSD != null))
        {
            loveLetterSpontaneousNoRomanticState = accepted ? TNSNames.LoveLetterResponseAccept : TNSNames.LoveLetterResponseReject;
            string name = accepted ? "sting_loveletter_accept" : "sting_loveletter_reject";
            Audio.StartObjectSound(actor.ObjectId, name, false);
            NotificationSystem.Show(loveLetterSpontaneousNoRomanticState, actorMSD.GetThumbnailKey(ThumbnailSize.Medium, 0), targetMSD.GetThumbnailKey(ThumbnailSize.Medium, 0), null, null, new bool[] { actorMSD.IsFemale, targetMSD.IsFemale }, false, null, new object[] { actorMSD, targetMSD });
            this.UpdateLTRAndRomanceVisibilityIfNeeded(actor, accepted);
        }
    }
    else
    {
        actorMSD = SimDescription.GetIMiniSimDescription(this.ActorSimID);
        targetMSD = SimDescription.GetIMiniSimDescription(this.TargetSimID);
        if ((actorMSD != null) && (targetMSD != null))
        {
            IMiniRelationship miniRelationship = actorMSD.GetMiniRelationship(targetMSD);
            if (miniRelationship != null)
            {
                if (miniRelationship.AreRomantic())
                {
                    loveLetterSpontaneousNoRomanticState = (miniRelationship.CurrentLTRLiking >= kLTRForHighRomanceTNS) ? TNSNames.LoveLetterSpontaneousHighRomantic : TNSNames.LoveLetterSpontaneousMediumRomantic;
                }
                else
                {
                    loveLetterSpontaneousNoRomanticState = TNSNames.LoveLetterSpontaneousNoRomanticState;
                }
                NotificationSystem.Show(loveLetterSpontaneousNoRomanticState, actorMSD.GetThumbnailKey(ThumbnailSize.Medium, 0), targetMSD.GetThumbnailKey(ThumbnailSize.Medium, 0), null, null, new bool[] { actorMSD.IsFemale, targetMSD.IsFemale }, false, null, new object[] { actorMSD, targetMSD });
            }
            SimDescription description3 = actorMSD as SimDescription;
            if (description3 != null)
            {
                Sim createdSim = description3.CreatedSim;
                if (createdSim != null)
                {
                    EventTracker.SendEvent(new MiniSimDescriptionTargetEvent(EventTypeId.kGetLoveLetterFromSim, createdSim, targetMSD));
                }
            }
        }
    }
}
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.111 seconds with 19 queries.