foundryvtt / foundryvtt

Public issue tracking and documentation for Foundry Virtual Tabletop - software connecting RPG gamers in a shared multiplayer environment with an intuitive interface and powerful API.
https://foundryvtt.com/
192 stars 10 forks source link

Combat round advancement should trigger end turn and star t turn events in addition to round events. #10786

Closed Fyorl closed 2 weeks ago

Fyorl commented 2 weeks ago

Originally reported by chrisosprey https://discord.com/channels/170995199584108546/1184176415139184731/1233710170949812264

Short Description of bug: Not 100% sure this isn't intendeted behaviour, but when nextRound() of Combat is called while it's the first combatants turn, _onStartTurn() is never called for that combatant, because the active combatant didn't change between turns, due to this line in V12s _manageTurnEvents():

    if ( (advanceTurn || changeCombatant) && next ) await this._onStartTurn(this.combatant);

In V11, it was always called. I feel the condition may need to look something like this: if ( (advanceTurn || changeCombatant || advanceRound) && next )