Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Server crash with Player.get_view_coordinates() and @EntityPreHook #233
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) if not player.dead and player.steamid != 'BOT': usercmd = make_object(UserCmd, stack) if usercmd.buttons & PlayerButtons.FORWARD and not player.buttons & PlayerButtons.FORWARD: player.get_view_coordinates()
Thanks! I'm able to reproduce the crash with CS:GO. Here is a crash dump:
The funny thing is that it seems like it's crashing while a hook is being created. I will investigate this.
I think I've got related problem on linux.
from players.entity import Player from events.hooks import PreEvent @PreEvent('weapon_fire') def on_weapon_fire(event): player = Player.from_userid(event['userid']) if player.view_player: player.view_coordinates = player.view_player.eye_location
The problem only comes out when this code executes on PreEvent. Everything works fine If we change
The crash is occurred on the line: