Aye, that certainly worked, and did the job.
Why not make the return an optional third argument to Link->Warp() instead of a separate function?
My reasons...
Gleeok expressly told me that it would be better to add new functions, than to modify or overload existing ones.
Replacing Link->Warp(int, int) with Link->Warp(int, int, int, ...) would break existing scripts, and probably quests.
Overloading a ZASM instruction and making redirects is a bloody pain...
What I did, is add in Link->WarpReturnSquare, int Link->WarpEffect, int Link->WarpSound, bool Link->PlayWarpSound
int WarpEffect allows setting an effect for a Link->Warp, or Link->PitWarp. This is andled with a switch-case, so only valid types do things differently.
int WarpSound, if set to > 0 allows playing a sound when warping. I expressly forbid this during sidewarps, and I probably need to vbound it.
bool PlayWarpSound is a flag that the user may toggle to allow a warp sound during a sidewarp. I need to rename it to SideWarpSound.
While I was at it, I plugged in Screen->ZapIn(), Screen->ZapOut, Screen->WavyIn(), Screen->WavyOut, and Screen->OpeningWipe
These allow replicating the in-build warp animations on demand, without warping. Could be useful. I know that I wanted to do that in the past for an effect, as did one of the other scripters.
Meanwhile, @Dimentio added SCC warp codes for Link, that also use these variables, so it isn't only for one thing.
Thankfully, all of these new ZScript things work, and I've been doing bug testing. Thus far, the only bugs that I was unable to kill, are caused by the SCC warp. I also patched in an SCC for setting Screen->D, while I was working with Dimentio. This felt natural, given that there is one to read it.
Anyway...thank you @Saffith for clarifying this.
P.S. Don't fret.I used intermediate handlers for allof this, rather than directly tying anything to a class variable.
Edit:
If you want to look at, or try out anything:
Sources | Windows Binaries
LinkClass::dowarp() is such a mess that I may just rewrite some parts of it to segregate normal, pit, and other warping.