optimizations

This commit is contained in:
Mylloon 2023-03-30 23:44:47 +02:00
parent 73f7155e45
commit c29e165cd2
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -64,7 +64,7 @@ class Cheat(Hack):
def cheat():
# Loop all entities
for i in range(1, 64): # 0 is world
for i in range(1, 32): # 0 is world
entity = mem.read_uint(
client + offset["dwEntityList"] + i * offset["entity_size"])
@ -104,7 +104,7 @@ class Cheat(Hack):
def cheat():
# Loop all entities
for i in range(1, 64): # 0 is world
for i in range(1, 32): # 0 is world
entity = mem.read_uint(
client + offset["dwEntityList"] + i * offset["entity_size"])
@ -124,12 +124,10 @@ class Cheat(Hack):
i = mem.read_int(
entity + offset["m_iGlowIndex"]) * offset["glow_obj_size"]
# TODO: Reduce write call
# Change color glow
mem.write_float(glow_obj_manager + i + offset["glow_R"], 1.)
mem.write_float(glow_obj_manager + i + offset["glow_G"], 0.)
mem.write_float(glow_obj_manager + i + offset["glow_B"], 0.)
# mem.write_float(glow_obj_manager + i + offset["glow_G"], 0.)
# mem.write_float(glow_obj_manager + i + offset["glow_B"], 0.)
mem.write_float(glow_obj_manager + i + offset["glow_A"], 1.)
# Render when not visible
@ -211,8 +209,6 @@ class Cheat(Hack):
self.nr__old_punch_y = 0.
def cheat():
# TODO: Reduce read/write call
# Check if player is shooting
if mem.read_int(local_player + offset["m_iShotsFired"]):
client_state = mem.read_uint(engine + offset["dwClientState"])
@ -259,7 +255,6 @@ class Cheat(Hack):
else:
# Not spraying
# TODO: Reset to middle?
self.nr__old_punch_x = 0.
self.nr__old_punch_y = 0.
@ -284,7 +279,7 @@ class Cheat(Hack):
mem = self.pm
offset = self.offsets
# Get module addresses
# Get module address
client = self.find_module("client")
# Get local player