Skip to content

[TF2] Entity.teleport broken after update #449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nullprop opened this issue Jul 9, 2022 · 3 comments
Closed

[TF2] Entity.teleport broken after update #449

nullprop opened this issue Jul 9, 2022 · 3 comments

Comments

@nullprop
Copy link

nullprop commented Jul 9, 2022

Entity.teleport doesn't work (for Players at least). Player loses all weapons and is unable to move after calling teleport.

sp info
[Source.Python]
IMPORTANT: Please copy the full output.
--------------------------------------------------------
Checksum      : b9ab18d02d2d57865788b80b30244db2
Date          : 2022-07-09 18:26:54.948099
OS            : Windows-10-10.0.19041
Game          : tf2
SP version    : 714
Github commit : d0ffd8ccbd1e9923c9bc44936f20613c1c76b7fb
Server plugins:
   00: Source.Python, (C) 2012-2021, Source.Python Team.
SP plugins:
   00: testplugin
--------------------------------------------------------

testplugin:

from events import Event
from players.entity import Player
from mathlib import Vector
from listeners.tick import Delay

@Event("player_spawn")
def on_player_spawn(game_event):
    player = Player.from_userid(game_event["userid"])
    player.teleport(Vector(0,0,0))
    # same happens with:
    # Delay(1, player.teleport)
@jordanbriere
Copy link
Contributor

Game data is likely outdated. I will try to update them tonight, or tomorrow. In the meantime, you could use Player.snap_to_position which is, not only much faster, but also not relying on any offset/signature.

@nullprop
Copy link
Author

nullprop commented Jul 9, 2022

Player.snap_to_position works. Thanks!

jordanbriere added a commit that referenced this issue Jul 9, 2022
jordanbriere added a commit that referenced this issue Jul 9, 2022
@jordanbriere
Copy link
Contributor

Untested, but all offsets should now be updated to the latest server binary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants