Interkarma / daggerfall-unity

Open source recreation of Daggerfall in the Unity engine
http://www.dfworkshop.net
MIT License
2.75k stars 333 forks source link

Removes totem delivery to foes during "Who Gets the Totem" #2690

Open JayH2971 opened 3 months ago

JayH2971 commented 3 months ago

See bug report here: https://www.reddit.com/gallery/1evrwhg . Handing over a nonexistent totem is a separate problem, and will require a more complicated fix. Not as urgent.

Mentill commented 3 months ago

The screenshot in the linked thread appears to be of a modded game. Is it confirmed this problem happens in the unmodded game? Perhaps a better solution is to remove it from the inventory rather than using the 'give item' command. I see a line that says take _totem_ from pc, that should work. Just dummying out what's there would keep the Totem in the player's inventory. Another option is to despawn the knights after they say their message.

JayH2971 commented 3 months ago

Is it confirmed this problem happens in the unmodded game?

There are no mods that affect the "give item to" action.

Perhaps a better solution is to remove it from the inventory rather than using the 'give item' command.

This is what I have done.

Another option is to despawn the knights after they say their message.

It's another option. Either one of them is fine for now, though there can always be discussion on which one would be better, and why.

petchema commented 3 months ago

Looking at the code, GiveItem doesn't check that the player's character has the item before handing it to the recipient, because that's not part of this action's semantics (it's never said it's the character giving the item). All it does as a last step is remove the item from the inventory, if it was there. So it's up to the quest to ensure GiveItem is attempted under the expected conditions, which it probably should anyway (ideally player should not be asked if you want to hand an object the character don't have). (I'm not sure why/how the Totem has been duplicated)