Open eyal282 opened 1 year ago
I really don't understand what's the problem here.
I really don't understand what's the problem here.
There's a function called EndScriptedMode, which is a function, as stupid as its name is, prevents the ending of a round. Used to be used in Tank Run and Dash, but after Tank Run stopped being bad, it's only used in Dash. When a round is prevented from being over, round_end event should not be called.
Oh, I see, lol.
Can confirm it happens with VScript, returning -1 from EndScriptedMode will still cause the round_end event to fire.
I'm not so sure this is really a bug. Preventing the round from ending doesn't seem to be the purpose of EndScriptedMode, rather it seems that it's meant to modify how the round ends.
round_end contains parameters that include a reason string, if any of these parameters are modified by EndScriptedMode other mods can check for the reason and decide to fire their code or not. Though this is obscure and wouldn't fix the problem for already-coded scripts that use round_end generally.
I'm not so sure this is really a bug. Preventing the round from ending doesn't seem to be the purpose of EndScriptedMode, rather it seems that it's meant to modify how the round ends.
There was a change in Tank Run very very recently that used this to prevent round from ending. If EndScriptedMode is used to prevent round from ending, it should not fire round_end event until the round ends.
The bug seems to be that returning an invalid scenario end reason from EndScriptedMode
prevents the round from ending properly, not that round_end
is fired even when EndScriptedMode
prevents the round from ending. IMO it would be good to allow mutations to control when rounds end, but using EndScriptedMode
this way seems to be unintended and round_end
being fired is just a side effect.
Best options to allow mutations to prevent the round from ending would probably either be to do nothing but pretend to have handled round ending if int returned from EndScriptedMode
is negative (or a reason that isn't handled normally). Or add a new callback specifically to prevent round ending.
The bug seems to be that returning an invalid scenario end reason from
EndScriptedMode
prevents the round from ending properly, not thatround_end
is fired even whenEndScriptedMode
prevents the round from ending. IMO it would be good to allow mutations to control when rounds end, but usingEndScriptedMode
this way seems to be unintended andround_end
being fired is just a side effect.Best options to allow mutations to prevent the round from ending would probably either be to do nothing but pretend to have handled round ending if int returned from
EndScriptedMode
is negative (or a reason that isn't handled normally). Or add a new callback specifically to prevent round ending.
EndScriptedMode is literally being used by official mutations to block scenario from ending.
EndScriptedMode is literally being used by official mutations to block scenario from ending.
Which mutations are using it?
EndScriptedMode is literally being used by official mutations to block scenario from ending.
Which mutations are using it?
Old Tank Run ( "old" = very new, happened under 3 months ago )
Description
I hope it's the same in Sourcemod as it is in VScript, because it was only tested in Sourcemod, but EndScriptedMode end of round prevent function calls round_end. This is very annoying and I would appreciate a fix.
Reproduction steps
I imagine it happens on the OnGameEvent_round_end because it should be identical to Sourcemod.
Additional files
No response