Skip to content

Server crash on player.teleport? #157

@Velocity-plus

Description

@Velocity-plus

Description

  • Game: Counter-Strike: Global Offensive
  • OS: Linux

Following code crashes server:

from listeners import OnPlayerRunCommand
from mathlib import Vector


@OnPlayerRunCommand
def on_player_run_command(player, user_cmd):
    player.teleport(velocity=Vector(100,100,100)) # Triggers crash

Original Issue:

from entities.entity import Entity
from entities.hooks import EntityCondition, EntityPreHook
from memory import make_object
from messages import SayText2
from players.entity import Player

TARGET_CLASSNAME = 'flashbang_projectile'

@EntityPreHook(
    EntityCondition.equals_entity_classname(TARGET_CLASSNAME),
    "start_touch")
def pre_start_touch(args):
    entity = make_object(Entity, args[0])

    if entity.classname != TARGET_CLASSNAME:
        return
    other = make_object(Entity, args[1])
    if not other.is_player():
        return

    player = make_object(Player, args[1])
    player.teleport(velocity=Vector(100,100,100)) # Triggers crash

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions