Commit b1c063a
committed
Fix "Double continuation" warning when using an item during NPC interaction
With item_enabled_npc allowing item usage while an NPC dialog is open, using an item attached a second script to the player. The NPC's script was backed up into the item script's bk_st and then reported as a lost "Double continuation", discarding the conversation the player was in.
The player is now detached from the running script before the item script is executed, and reattached to it afterwards, so an item that does not open a window of its own leaves the conversation intact.
Detaching the script is not enough on its own, because the answer a menu() or input() is waiting for is kept in the session data rather than in the script state. An item script that opened a menu of its own found that pending answer already set and read it as its own, returning a selection the player never made for it, so a dungeon teleport scroll used while an NPC menu was open warped the player immediately instead of asking where to go. The pending answer is now saved and cleared before the item script runs, and handed back only when the previous script is reattached.
An item script that does pause to show its own window is a different case: by that point the client is already displaying that window, so the previous conversation can no longer be resumed and its script is released instead. Restoring it there would leave the client showing one dialog while the server expects another, which locks the player out of both.
Based on rathena commit:
commit 3c93e30
Author: Lemongrass3110 <lemongrass@kstp.at>
Date: Wed Oct 29 18:36:28 2025 +0000
Fixed an issue with item_enabled_npc (#9606)
Fixes #8625
Thanks to @thanna
Fixes #34711 parent bd8fe24 commit b1c063a
1 file changed
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5496 | 5496 | | |
5497 | 5497 | | |
5498 | 5498 | | |
| 5499 | + | |
| 5500 | + | |
| 5501 | + | |
| 5502 | + | |
| 5503 | + | |
| 5504 | + | |
| 5505 | + | |
| 5506 | + | |
| 5507 | + | |
| 5508 | + | |
| 5509 | + | |
| 5510 | + | |
| 5511 | + | |
| 5512 | + | |
| 5513 | + | |
| 5514 | + | |
| 5515 | + | |
| 5516 | + | |
| 5517 | + | |
| 5518 | + | |
| 5519 | + | |
| 5520 | + | |
| 5521 | + | |
5499 | 5522 | | |
| 5523 | + | |
| 5524 | + | |
| 5525 | + | |
| 5526 | + | |
| 5527 | + | |
| 5528 | + | |
| 5529 | + | |
| 5530 | + | |
| 5531 | + | |
| 5532 | + | |
| 5533 | + | |
| 5534 | + | |
| 5535 | + | |
| 5536 | + | |
| 5537 | + | |
| 5538 | + | |
| 5539 | + | |
| 5540 | + | |
| 5541 | + | |
| 5542 | + | |
| 5543 | + | |
5500 | 5544 | | |
5501 | 5545 | | |
5502 | 5546 | | |
| |||
0 commit comments