Describe the bug
In multiplayer games, adding extra turns (e.g., via Lighthouse Chronologist) was not handled correctly. The method getCurrentTurnPosition() was mistakenly used, but it does not exist and is not suitable for managing turn order. Inserting and managing extra turns happened at the wrong place in the turn sequence.
To Reproduce
Steps to reproduce the bug:
- Start a multiplayer game with a card that grants extra turns (e.g., Lighthouse Chronologist).
- Activate the ability to gain an extra turn.
- Observe the turn order and the behavior of extra turns.
- Bug: Extra turns are not inserted correctly or cause compilation errors.
Expected behavior
Extra turns should be correctly inserted into the turn order so that the player who receives the extra turn can take it at the appropriate time. No compilation errors should occur.
Screenshots
Not applicable / None available.
Desktop (please complete the following information):
- OS: [e.g. Windows 10]
- Browser: [not applicable]
- Version: [Forge build before 2026-04-01]
Smartphone (please complete the following information):
- Device: [not applicable]
- OS: [not applicable]
- Version: [not applicable]
Additional context
- Turn order is managed via the order of players in the
PlayerCollection (ingamePlayers) and a stack of ExtraTurn objects in PhaseHandler.
- The incorrect use of
getCurrentTurnPosition() led to compilation errors and faulty logic.
- The fix was to set the position of the extra turn directly in
PhaseHandler.addExtraTurn() based on the stack size and to adjust the tests accordingly.
- After the fix, handling of extra turns is robust and compatible with multiplayer scenarios.
Analysis
Turn order is managed via the order of players in the PlayerCollection (ingamePlayers) and a stack of ExtraTurn objects in the PhaseHandler.
The position of an extra turn in the turn order can be determined by the size of the stack (extraTurns.size()).
The incorrect use of getCurrentTurnPosition() led to compilation errors and faulty logic.
Solution/Approach (as of 2026-04-01)
Code Correction
The erroneous call to getCurrentTurnPosition() in AddTurnEffect was removed.
The turn order position of an ExtraTurn is now set directly in PhaseHandler.addExtraTurn() based on the stack size.
The method setTurnOrderPosition() is still used, but is no longer set with a non-existent method.
The tests were updated so they no longer access the non-existent method, but instead check that setTurnOrderPosition() is called when adding an ExtraTurn.
Test Adjustment
The tests now check that the method setTurnOrderPosition() is called when adding an ExtraTurn.
It is still verified that extra turns are only added for active players.
Build and Test Process
It is essential to first run a full build with mvn clean install so that all dependencies are resolved correctly.
Afterwards, tests in the forge-game module can be run specifically.
Result
The handling of extra turns is now robust and compatible with multiplayer scenarios.
The tests are updated and correctly verify the desired behavior.
Compilation errors due to the non-existent method are resolved.
The changes were made and tested on 2026-04-01.
Describe the bug
In multiplayer games, adding extra turns (e.g., via Lighthouse Chronologist) was not handled correctly. The method
getCurrentTurnPosition()was mistakenly used, but it does not exist and is not suitable for managing turn order. Inserting and managing extra turns happened at the wrong place in the turn sequence.To Reproduce
Steps to reproduce the bug:
Expected behavior
Extra turns should be correctly inserted into the turn order so that the player who receives the extra turn can take it at the appropriate time. No compilation errors should occur.
Screenshots
Not applicable / None available.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
PlayerCollection(ingamePlayers) and a stack ofExtraTurnobjects inPhaseHandler.getCurrentTurnPosition()led to compilation errors and faulty logic.PhaseHandler.addExtraTurn()based on the stack size and to adjust the tests accordingly.Analysis
Turn order is managed via the order of players in the PlayerCollection (ingamePlayers) and a stack of ExtraTurn objects in the PhaseHandler.
The position of an extra turn in the turn order can be determined by the size of the stack (extraTurns.size()).
The incorrect use of getCurrentTurnPosition() led to compilation errors and faulty logic.
Solution/Approach (as of 2026-04-01)
Code Correction
The erroneous call to getCurrentTurnPosition() in AddTurnEffect was removed.
The turn order position of an ExtraTurn is now set directly in PhaseHandler.addExtraTurn() based on the stack size.
The method setTurnOrderPosition() is still used, but is no longer set with a non-existent method.
The tests were updated so they no longer access the non-existent method, but instead check that setTurnOrderPosition() is called when adding an ExtraTurn.
Test Adjustment
The tests now check that the method setTurnOrderPosition() is called when adding an ExtraTurn.
It is still verified that extra turns are only added for active players.
Build and Test Process
It is essential to first run a full build with mvn clean install so that all dependencies are resolved correctly.
Afterwards, tests in the forge-game module can be run specifically.
Result
The handling of extra turns is now robust and compatible with multiplayer scenarios.
The tests are updated and correctly verify the desired behavior.
Compilation errors due to the non-existent method are resolved.
The changes were made and tested on 2026-04-01.