Skip to content
This repository has been archived by the owner on Dec 26, 2021. It is now read-only.

Commit

Permalink
Fix GameMode (#4414)
Browse files Browse the repository at this point in the history
* update ontick and actor

* fix gamemode being scuffed

* Fix how did this even compile
  • Loading branch information
Synx173 authored Aug 16, 2021
1 parent b7dbdce commit b516a10
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 83 deletions.
7 changes: 3 additions & 4 deletions Horion/Module/Modules/Jetpack.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "Jetpack.h"

#include "../../../Utils/Logger.h"

Jetpack::Jetpack() : IModule('F', Category::MOVEMENT, "Fly around like you had a Jetpack!") {
Expand All @@ -18,7 +19,6 @@ const char* Jetpack::getModuleName() {
}

void Jetpack::onTick(C_GameMode* gm) {
logF("hello");
float calcYaw = (gm->player->yaw + 90) * (PI / 180);
float calcPitch = (gm->player->pitch) * -(PI / 180);

Expand All @@ -27,8 +27,7 @@ void Jetpack::onTick(C_GameMode* gm) {
moveVec.x = cos(calcYaw) * cos(calcPitch) * speedMod;
moveVec.y = sin(calcPitch) * speedMod;
moveVec.z = sin(calcYaw) * cos(calcPitch) * speedMod;

__debugbreak();

gm->player->lerpMotion(moveVec);
} else {
delay++;
Expand Down Expand Up @@ -59,4 +58,4 @@ void Jetpack::onTick(C_GameMode* gm) {
delay = 0;
}
}
}
}
14 changes: 6 additions & 8 deletions Memory/GameData.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "GameData.h"

#include <Windows.h>

#include "../Utils/Logger.h"
#include "../Utils/Utils.h"

Expand Down Expand Up @@ -92,7 +93,6 @@ void GameData::hide() {
}

void GameData::updateGameData(C_GameMode* gameMode) {

retrieveClientInstance();
g_Data.localPlayer = g_Data.getLocalPlayer();

Expand All @@ -102,19 +102,17 @@ void GameData::updateGameData(C_GameMode* gameMode) {

if (g_Data.localPlayer != nullptr) {
C_GuiData* guiData = g_Data.clientInstance->getGuiData();



if (guiData != nullptr) {
{
logF("we out hjere");
auto vecLock = Logger::GetTextToPrintLock();
auto* stringPrintVector = Logger::GetTextToPrint();
#ifdef _DEBUG
int numPrinted = 0;
std::vector<TextForPrint>::iterator it;
for (it = stringPrintVector->begin(); it != stringPrintVector->end(); ++it) {
numPrinted++;
if(numPrinted > 20){
if (numPrinted > 20) {
break;
}

Expand All @@ -133,7 +131,7 @@ void GameData::updateGameData(C_GameMode* gameMode) {
std::vector<std::string>::iterator it;
for (it = stringPrintVector.begin(); it != stringPrintVector.end(); ++it) {
numPrinted++;
if(numPrinted > 20){
if (numPrinted > 20) {
break;
}

Expand Down Expand Up @@ -223,7 +221,7 @@ void GameData::initGameData(const SlimUtils::SlimModule* gameModule, SlimUtils::
logF("base: %llX", g_Data.getModule()->ptrBase);
logF("clientInstance %llX", g_Data.clientInstance);
logF("localPlayer %llX", g_Data.getLocalPlayer());
if (g_Data.clientInstance != nullptr){
if (g_Data.clientInstance != nullptr) {
logF("minecraftGame: %llX", g_Data.clientInstance->minecraftGame);
logF("levelRenderer: %llX", g_Data.clientInstance->levelRenderer);
}
Expand Down Expand Up @@ -257,4 +255,4 @@ void GameData::log(const char* fmt, ...) {
std::string msg(message);
g_Data.textPrintList.push_back(msg);
va_end(arg);
}
}
Loading

0 comments on commit b516a10

Please sign in to comment.