fix: dialogue / combat queue conflict#1098
Open
DesecratedTree wants to merge 1 commit into
Open
Conversation
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Bug
When a dialogue (like a level-up or a random event) opened during combat, the player and their attacker was completely frozen. Combat stopped with no movement, no attacks, no damage. The player had to manually dismiss the dialogue before combat resumed. When this would happen, damage would "pool up behind the dialogue". This is unintended behavior and reference videos alongside historical sources show that combat actually interrupts the dialogue interface. Furthermore, this adds in the chat message for leveling up and ensures the player sees the message even if the dialogue is closed by a strong queue action.
Changes
CombatMovement.kt
Removed the character.dialogue != null early return from tick().
Before: If the player had a dialogue open, CombatMovement.tick() returned immediately and the player stopped moving toward their target and stopped attacking.
After: Combat movement ticks normally regardless of dialogue state. The player continues chasing targets, pathfinding, and triggering attacks.
Combat.kt
Removed the character.dialogue != null early return from combat().
Before: Even if CombatMovement.tick() ran, the actual attack logic in Combat.combat() also bailed out when dialogue was open. No swings, no damage, no XP until the dialogue was cleared.
After: Attack rolls, damage, and combat XP all process normally while dialogue is visible.
ActionQueue.kt
Strong actions now bypass canProcess(), and Strong actions close dialogue.
Two changes here:
process() now checks action.priority == ActionPriority.Strong || canProcess() instead of just canProcess(). This means player damage hits (strongQueue("hit")) execute immediately instead of pooling in the queue behind the dialogue interrupt check.
The existing closeMenu() call in tick() (which fires when a Strong action is pending) now also calls closeDialogue(). Getting hit is a Strong action, so it force-closes any open dialogue — matching the original RS2 behavior where combat interrupts the level-up display.
LevelUp.kt
Added a message() call alongside the level-up interface.
The congratulations text is now sent as a ChatType.Game chat message in addition to being displayed in the level-up interface. This is historically accurate to 2011 RS2, where both the chatbox message and the interface were sent on level-up.