p2sr / SourceAutoRecord

Speedrun plugin for Source engine games.
https://sar.portal2.sr/
MIT License
93 stars 29 forks source link

`end` speedrun rule doesn't work in Mel #122

Closed ThisAMJ closed 7 months ago

ThisAMJ commented 1 year ago

Since Mel presumably uses a different mechanism to transition between levels, our Engine::ChangeLevel hook doesn't get triggered, which means engine->isLevelTransition is never set to true which means the map end rules are never tested.

The other possibility is that Mel somehow overrides the function, or has a different offset, which I think is unlikely.

mlugg commented 1 year ago

Needs confirming: how does Mel transition between maps? My guess is that it's running changelevel2 manually (the function AMJ mentions just runs that command). If so, we should just hook that command instead (as well as changelevel).

ThisAMJ commented 1 year ago

By the looks of things, it just uses changelevel! More specifically, the entity input end_command.Command(changelevel <next map>)