Add features folder and bhop
This commit is contained in:
parent
5849eb2ed3
commit
1f1df22414
4
Makefile
4
Makefile
|
@ -5,7 +5,7 @@ INCLUDES=-Isrc/include/sdk/common -Isrc/include/sdk/public -Isrc/include/sdk/pm_
|
|||
CFLAGS=-Wall -Wextra -Wno-write-strings -m32 -fPIC $(INCLUDES)
|
||||
LDFLAGS=
|
||||
|
||||
OBJS=obj/main.c.o obj/globals.c.o obj/hooks.c.o
|
||||
OBJS=obj/main.c.o obj/globals.c.o obj/hooks.c.o obj/features/movement.c.o
|
||||
BIN=libhlcheat.so
|
||||
|
||||
.PHONY: clean all inject
|
||||
|
@ -29,5 +29,5 @@ $(BIN): $(OBJS)
|
|||
$(CC) $(CFLAGS) -shared -o $@ $(OBJS) $(LDFLAGS)
|
||||
|
||||
$(OBJS): obj/%.c.o : src/%.c
|
||||
@mkdir -p obj/
|
||||
@mkdir -p obj/features/
|
||||
$(CC) $(CFLAGS) -c -o $@ $< $(LDFLAGS)
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
|
||||
#ifndef _MOVEMENT_H
|
||||
#define _MOVEMENT_H
|
||||
|
||||
#include "../../include/sdk.h"
|
||||
|
||||
void bhop(usercmd_t* cmd);
|
||||
|
||||
#endif /* _MOVEMENT_H */
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "include/movement.h"
|
||||
#include "../include/sdk.h"
|
||||
#include "../include/globals.h"
|
||||
|
||||
void bhop(usercmd_t* cmd) {
|
||||
/* TODO: Check !bhop_var */
|
||||
if (false || i_pmove->movetype != MOVETYPE_WALK)
|
||||
return;
|
||||
|
||||
static bool was_in_air = false;
|
||||
|
||||
if (was_in_air && !(i_pmove->flags & FL_ONGROUND))
|
||||
cmd->buttons &= ~IN_JUMP;
|
||||
|
||||
was_in_air = (i_pmove->flags & FL_ONGROUND) == 0;
|
||||
}
|
Loading…
Reference in New Issue