Description
I have a custom command "/lobby" which teleports players to the lobby coords on my server using the Actor's teleport function. The issue is that once teleported, players end up facing up or down, instead of keeping their camera position. This seems to get fixed by inling the function which is:
char mem[48];
auto computeTarget = (TeleportTarget * (*)(void*, class Actor&, class Vec3, class Vec3*, class AutomaticID<class Dimension, int>, class RelativeFloat, class RelativeFloat, int))(&TeleportCommand::computeTarget);
auto target = computeTarget(mem, *this, to, nullptr, dimId, 0, 0, 15);
TeleportCommand::applyTarget(*this, *target);
and changing the RelativeFloat values to something else than 0, which ends up something like this with the necessary modifications:
char mem[48];
auto computeTarget = (TeleportTarget * (*)(void*, class Actor&, class Vec3, class Vec3*, class AutomaticID<class Dimension, int>, class RelativeFloat, class RelativeFloat, int))(&TeleportCommand::computeTarget);
auto target = computeTarget(mem, *wp, vc, nullptr, dimid, 1, 1, 15);
TeleportCommand::applyTarget(*wp, *target);
That's using the Vec4 struct of LLTpa.
I don't know if it has to do with my build environment, I'm building in Visual Studio 2019 with the LiteLoaderSDK repo, v142 tools and a v142 compiled SymDBHelper.lib, since the latest one in the releases is compiled using v143 tools and it would give me errors about LTCG.
Do you guys have any idea why would this happen?