AAEmu/AAEmu

[BUG] Owl mailbox not working

Closed this issue · 9 comments

I confirm that:

  • I understand that if I do not agree to the following points by marking the checkboxes my issue will be ignored.
  • I have searched existing issues to see if the issue has already been opened, and I have checked the commit log to see if the issue has been resolved since my server was last updated.
  • I am currently on the latest commit of the branch when reporting this bug

Code branch that is affected by this issue

develop

Bug description

Owl mailbox (Item ID 19090) not working correctly.
You can receive mail but you cannot send it.

Steps to reproduce

Place an owl mailbox outside a house and try to send mail

Expected behavior

Screenshots
Bug boîte aux lettres de hibou

Any additional context for this bug

Error message :
“No mailboxes nearby”

This bug is not related to mailboxes, but rather to furniture where the distance check of furniture that are on houses that have been rotated is not correct. You'll notice that if you manually summon one /doodad spawn 320 at the same location, that it will work.

This is part or a long ongoing bug related to houses and rotations (or anything that can have child doodads really)

Hi
The house has not been rotated, and we cannot use /doodad spawn to replace all mailboxes that players have purchased or crafted

I was giving the doodad spawn as a test, not to actually replace them.

For un-rotated houses, the issue seems to be caused by the Doodad template group ID check:

// Doodad GroupID 6 is "Other - Mailboxes"
if (doodad.Template.GroupId == 6)

Only the "Mailbox" with item ID 320 is in the "Other - Mailbox" group, but there are others that are not:

  • The "Owl Mailbox" (3563) that can be placed as decor on your house belongs to the "Housing - Furniture (69)" group
  • The "Any-Post Owl" (2032) that can be summoned anywhere is in the "collide check (72)" group.

Something like this check works instead:
if (doodad.CurrentFuncs.Any(func => func.FuncType == "DoodadFuncNaviOpenMailbox"))

Only Doodads that in their current state support opening of the mailbox can send mails, and a mailbox in the end animation (when the owl flies off) cannot send mails (the client closes the mailbox windows then anyway).

Actually never tested on retail if trying to send a mail while the owl as away would work or not.
I do agree that my basic check I did back in the day, isn't the most perfect way to handle this. But I am almost certain that the range check is the actual issue, and not the mailbox type (note that it is a normal post own in the image)

Edit: it might also be possible that using one on your house simply doesn't send the doodad objId with it (not tested yet)

Sorry I should've mentioned I tested it in game (with an un-rotated house) 😅

The post owl in the image is placed on a house, so it's the "Owl Mailbox" (3563) item which is in the "Housing - Furniture (69)" group and not the plain mailbox that sits next to a Warehouse Manager NPC, and that's why it fails the group check. It does still send the doodad objId for it 👍

@mgpreston want me to make a fix for this, or will you?

Your solution from above should indeed be good enough, maybe with a added null-check for CurrentFuncs?
Then again, if you can manage to get a doodad without Funcs passed up to here, you were almost certainly cheating in some way. And even then it might not be null there and just a empty list.

@ZeromusXYZ I gave the pull request a go. Great work everyone involved in this project btw 😄