8dcc / tf2-cheat

Linux cheat for Team Fortress 2 made in C
GNU General Public License v3.0
23 stars 5 forks source link

Auto rocket jump is broken #16

Closed ghost closed 8 months ago

ghost commented 8 months ago

you can press right mouse button, but it won't rocket jump, even with the default rocket launcher. did the ps1 graphics update mess it up?

8dcc commented 8 months ago

It works fine for me, even with that setting enabled.

https://github.com/8dcc/tf2-cheat/assets/29655971/e7c2f8f6-5bc4-4acf-8016-a6734025cffe

ghost commented 8 months ago

interesting. let me download it again to see if it works

ghost commented 8 months ago

nope, just reinstalled the cheat but it still doesn't work. here i tried to rocket jump with mouse2, then proceeded to rocket jump manually.

https://github.com/8dcc/tf2-cheat/assets/152049532/70d3c407-f199-4a26-8594-053f5661348f

8dcc commented 8 months ago

here i tried to rocket jump with mouse2, then proceeded to rocket jump manually.

So the cheat did shoot that first rocket? Or was that you?

ghost commented 8 months ago

no, i shot that first rocket, then pressed mouse2

ghost commented 8 months ago

oh wait... i checked the cheat's files and realized that it uses secondary attack as input for the rocketjump. since i use a laptop, i unbound mouse2 to secondary attack and instead bound q to secondary attack. dangit i'm just as dumb as soldier lmao

8dcc commented 8 months ago

Okay, then I need you to put a breakpoint in the autorocketjump function.

Compile the cheat using:

sudo make clean debug inject

And once it's loaded, press Ctrl+C inside the terminal where you injected the cheat, and put the following lines into the prompt:

(gdb) break movement.c:94
Breakpoint 1 at 0xdbfe69af: file src/features/movement.c, line 94.
(gdb) continue
Continuing.

Then, try the autorocketjump in-game and let me know if the game freezes, and the prompt changes to:

Thread 1 "hl2_linux" hit Breakpoint 2, autorocketjump (cmd=0x352d58c4) at src/features/movement.c:94
94      if (METHOD(g.localweapon, GetWeaponId) != TF_WEAPON_ROCKETLAUNCHER)
(gdb)

If it does, type in the prompt:

(gdb) break movement.c:97
Breakpoint 2 at 0xdbfe69c7: file src/features/movement.c, line 97.
(gdb) break movement.c:131
Breakpoint 3 at 0xdbfe6a69: file src/features/movement.c, line 132.

Then, continue two more times and paste the output of those commands here. It should look something like:

(gdb) continue
Continuing.

Thread 1 "hl2_linux" hit Breakpoint 2, autorocketjump (cmd=0x352d58c4) at src/features/movement.c:97
97      if (!can_shoot())
(gdb) continue
Continuing.

Thread 1 "hl2_linux" hit Breakpoint 3, autorocketjump (cmd=0x352d58c4) at src/features/movement.c:133
133     cmd->buttons |= IN_ATTACK | IN_DUCK | IN_JUMP;
(gdb)
8dcc commented 8 months ago

oh wait... i checked the cheat's files and realized that it uses secondary attack as input for the rocketjump. since i use a laptop, i unbound mouse2 to secondary attack and instead bound q to secondary attack. dangit i'm just as dumb as soldier lmao

Ah, sorry for not mentioning that. Thanks for taking the time to look at the source.

ghost commented 8 months ago

yeah sorry for wasting your time