Skip to content
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

PlayerEntity.run_command & BotCmd bug #68

Closed
high-voltage opened this issue Aug 24, 2015 · 2 comments
Closed

PlayerEntity.run_command & BotCmd bug #68

high-voltage opened this issue Aug 24, 2015 · 2 comments

Comments

@high-voltage
Copy link

I tried hooking run_command in CSGO and came up with an issue.
The attributes in BotCmd are not working or are mixed. What should be BotCmd.buttons is actually BotCmd.weaponsubtype. The most attributes are not giving correct values.

import memory

from entities.hooks import EntityPreHook
from entities.hooks import EntityCondition
from entities.helpers import index_from_pointer

from players.bots import BotCmd
from players.entity import PlayerEntity

@EntityPreHook(EntityCondition.is_player, 'run_command')
def pre_player_run_command(args):
    index = index_from_pointer(args[0])
    cmd = memory.make_object(BotCmd, args[1])
    player = PlayerEntity(index)
    print(cmd.weaponsubtype)
@Ayuto
Copy link
Member

Ayuto commented Aug 24, 2015

CCSPlayer::RunCommand takes a CUserCmd argument and not a CBotCmd argument. In CS:S (or Orangebox in general) CBotCmd and CUserCmd are identical in their structure. However, in CS:GO they aren't. That's why you are getting this weird behaviour.

I will go ahead and expose CUserCmd as well.

@high-voltage
Copy link
Author

Alright, thanks!

Ayuto added a commit that referenced this issue Aug 24, 2015
@Ayuto Ayuto closed this as completed Aug 25, 2015
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