Skip to content

Server crash with Player.get_view_coordinates() and @EntityPreHook #233

@ThaPwned

Description

@ThaPwned

Info:

Date          : 2017-12-17 20:33:10.774142
OS            : Linux-4.9.13eorfix-x86_64-with-debian-8.9
Game          : csgo
SP version    : 622
Server plugins:
   00: Source.Python, (C) 2012-2016, Source.Python Team.
SP plugins:
   00: crash_test

Code to reproduce the crash:

from entities.hooks import EntityCondition
from entities.hooks import EntityPreHook
from memory import make_object
from players import UserCmd
from players.constants import PlayerButtons
from players.entity import Player


@EntityPreHook(EntityCondition.is_player, 'run_command')
def run_command(stack):
    player = make_object(Player, stack[0])

    if not player.dead and player.steamid != 'BOT':
        usercmd = make_object(UserCmd, stack[1])

        if usercmd.buttons & PlayerButtons.FORWARD and not player.buttons & PlayerButtons.FORWARD:
            player.get_view_coordinates()

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