-
Notifications
You must be signed in to change notification settings - Fork 932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ownership by dead actors is not cleared from picked items (Bug #4328) #1617
Conversation
I wonder how the game supposed to behave if the owner is not unique NPC, e.g. guard. |
I think you forgot to check if victimRef was not found, which because you set activeOnly could easily happen if they moved to another cell (but I'm not saying activeOnly should be false because that search is a whole lot more expensive). Also there are items in the starting cell owned by 'a shady smuggler' that don't actually exist. akortunov's question is interesting, sure. |
Setting activeOnly to true was an accident... but I guess the owner of an item the player tries to steal is in the same cell as that item or in an adjacent cell in case of, say, towns in most cases. |
That if test bothers me a bit. Isn't it the same as empty || !dead ? |
A nuance I didn't mention: for performance reasons, OpenMW will always consider owners that don't have a dead reference in the cells that were loaded at the time you were taking an item alive for the purpose of increasing the stolen item counter - this includes NPCs like "a shady smuggler" which don't have a reference in the world at all, and regular NPCs that happened not to be loaded while you were taking the item.
I'm not sure if that's so. Did you test? Deleted or 'cleared' objects can still be accessible. (Yes, very unintuitive, but that was required to make a broken-ass script for the gateway ghost quest work..) |
Nope, I just took a wild guess, went through the corpse clearing code and it, um, looked that way. Well, good to know. |
Just tested it. Unless I'm imagining things, it appears not to work when an item is stolen from a container owned by a dead NPC lying nearby, but it works fine otherwise, even if the corpse is disposed. Edit: phew, now everything works just right. |
I think the intention of show owned is to indicate whether taking is a crime, which it still is with this PR if I understood right. So we don't need to change anything else. |
Could you rebase the commit that doesn't build (empty/isEmpty), and maybe a few others while already at it. |
Done. |
Tracker
Prevent mStolenItems for specific item ID from increasing in this case.
Note: the stolen tag is not cleared from such items upon loading a saved game.