Open alexiscoutinho opened 1 year ago
@Rayman1103 What do you think about using EndScriptedMode
to solve this?
@Rayman1103 What do you think about using
EndScriptedMode
to solve this?
I wouldn't want to rely on EndScriptedMode for this. That should only be used exclusively in Mutations.
Description
This is the main issue of #283. If the only human players die before the
finale_win
event, the mission will fail and the round will restart even if survivor bots were normally rescued. This already happens in sacrifice type finales if the only human dies in the sacrifice outro (generally if the player was already B&W), but could also theoretically happen in custom maps if, for example, a random survivor is picked to die (if there are at least 2 rescued), viakill
cmd, in the outro cutscene and that unlucky one is the only human. This happens becausesb_all_bot_game
is set to 0 by default.Note that the game already treats such deaths after
finale_win
as irrelevant (they don't even appear in the stats). While the worst offender would be to have a restart while the players are already frozen (afterfinale_vehicle_leaving
), the same issue can also be extended to during the fade out or possibly even sooner, before the human even reaches the vehicle if all bots are already inside. This last scenario could be addressed by enabling anEndScriptedMode
callback afterfinale_vehicle_ready
to prevent a premature round end and instead check if all bots are inside the vehicle. If yes, then the outro sequence would be started.Reproduction steps
Play The Sacrifice finale with bots and sacrifice yourself while B&W.