-
Notifications
You must be signed in to change notification settings - Fork 378
Fix exceptions when bashing certain doors #2449
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
Conversation
Leverages ActivateStaticDoor when bashing static doors so all door types are handled. Currently, only exterior doors in settlements are handled. This mimics classic behavior with the exception that dungeon exterior doors can be bashed too.
|
This looks like a rather large refactor just to fix an exception. I'd prefer to see fewer lines touched. What's the actual issue being fixed here? If you can give me a repro save, I might like to handle this a different way. |
|
Sorry, I could have explained better. Right now you will get exceptions thrown when either bashing a building interior door or dungeon exterior door. In addition, it doesn't transition the player through the door. I'm letting ActivateStaticDoor handle the static door transitions for bashing since most of the logic is already there. I added a little extra logic to handle bashing but github's diffing went a little wild. If you look at what was "removed" vs what was "added" it is largely the same with a few exceptions (at least in the case of ActivateStaticDoor). I zipped a couple of saves with a character standing next to doors that will yield exceptions when you bash them. |
|
Thank you for save. I'll look into the issue when I can. :) |
This reverts commit aec077e.
|
This error is still being hit by users. After fixing the public API changes, I'd be willing to merge this |
|
There was one public method that I renamed. Its name is now reverted to what it was originally per Kab's request. |
|
|
||
| // Handle clicking exterior door with Open spell active | ||
| if (HandleOpenEffectOnExteriorDoor(buildingLockValue)) | ||
| if (HandleOpenEffectOnExteriorDoor(buildingLockValue) && !isBash) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you put the check in the wrong order. Currently, a bash will consume an incumbent Open effect, but will not activate it. If you rewrite it as !isBash && HandleOpenEffectOnExteriorDoor(buildingLockValue), then a bash will neither consume nor activate the Open effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've also noticed another DFU issue here: by making the door "unlocked", you enable the "greeting" message, despite having bypassed the lock. This is inconsistent with lockpicking, which moves forward down the function without unlocking the door.
The check should probably be rewritten as if(!buildingUnlocked || !HandleOpenEffectOnExterior(buildingLockValue) (assuming you still have the !isBash check above), so that buildingUnlocked remains false, and the greeting message will be avoided like in the lockpicking case.
|
After having run tests, the changelist mostly works as advertised, outside the Open issue I've mentioned. I've run tests on classic DF, and here's what I've concluded from bashing doors:
I'm fine with DFU diverging on point 1 and 3. I know this changelist is about external doors, but while we're on it, I think we should update Summary of my recommandations: Must:
Nice to have:
|
|
OK, should be ready for merging now. |
Leverages ActivateStaticDoor when bashing static doors so all door types are handled. Currently, only exterior doors in settlements are handled. This mimics classic behavior with the exception that dungeon exterior doors can be bashed too.