Skip to content
Permalink
Browse files

Merge PR #2360: plugins/rl: Plugin update for game's latest version

  • Loading branch information...
mkrautz committed Jun 23, 2016
2 parents f28e9b7 + b1a9a36 commit ff09c041a0fa48fb871b3cbbd862ad79edf15ce8
Showing with 8 additions and 37 deletions.
  1. +8 −37 plugins/rl/rl.cpp
@@ -12,11 +12,8 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
// Boolean value to check if game addresses retrieval is successful
bool ok;

// Create containers to stuff our raw data into, so we can convert it to Mumble's coordinate system
float avatar_pos_corrector[3], camera_pos_corrector[3], avatar_front_corrector[3], camera_front_corrector[3], camera_top_corrector[3];

// Avatar pointers
procptr32_t avatar_base = peekProc<procptr32_t>(pModule + 0x016FEC04);
procptr32_t avatar_base = peekProc<procptr32_t>(pModule + 0x0170B5A4);
if (!avatar_base) return false;
procptr32_t avatar_offset_0 = peekProc<procptr32_t>(avatar_base + 0x448);
if (!avatar_offset_0) return false;
@@ -28,44 +25,18 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
if (!avatar_offset) return false;

// Peekproc and assign game addresses to our containers, so we can retrieve positional data
ok = peekProc(avatar_offset + 0x0, &avatar_pos_corrector, 12) && // Avatar Position values (Z, Y and X).
peekProc(pModule + 0x016FEE40, &camera_pos_corrector, 12) && // Camera Position values (Z, Y and X).
peekProc(avatar_offset + 0xC, &avatar_front_corrector, 12) && // Avatar Front values (Z, Y and X).
peekProc(pModule + 0x016FEE28, &camera_front_corrector, 12) && // Camera Front Vector values (Z, Y and X).
peekProc(pModule + 0x016FEE34, &camera_top_corrector, 12); // Camera Top Vector values (Z, Y and X).
ok = peekProc(avatar_offset + 0x0, avatar_pos, 12) && // Avatar Position values (X, Y and -Z).
peekProc(pModule + 0x0170B7E0, camera_pos, 12) && // Camera Position values (X, Y and -Z).
peekProc(avatar_offset + 0xC, avatar_front, 12) && // Avatar Front values (X, Y and -Z).
peekProc(pModule + 0x0170B7C8, camera_front, 12) && // Camera Front Vector values (X, Y and -Z).
peekProc(pModule + 0x0170B7D4, camera_top, 12); // Camera Top Vector values (X, Y and -Z).

// This prevents the plugin from linking to the game in case something goes wrong during values retrieval from memory addresses.
if (! ok)
return false;

/*
Mumble | Game
X | Z
Y | Y
Z | -X
*/
avatar_pos[0] = avatar_pos_corrector[2];
avatar_pos[1] = avatar_pos_corrector[1];
avatar_pos[2] = -avatar_pos_corrector[0]; // Convert from right handed to left handed coordinate system

camera_pos[0] = camera_pos_corrector[2];
camera_pos[1] = camera_pos_corrector[1];
camera_pos[2] = -camera_pos_corrector[0]; // Convert from right handed to left handed coordinate system

avatar_front[0] = avatar_front_corrector[2];
avatar_front[1] = avatar_front_corrector[1];
avatar_front[2] = avatar_front_corrector[0];

avatar_top[2] = -1; // This tells Mumble to automatically calculate top vector using front vector.

camera_front[0] = camera_front_corrector[2];
camera_front[1] = camera_front_corrector[1];
camera_front[2] = camera_front_corrector[0];

camera_top[0] = camera_top_corrector[2];
camera_top[1] = camera_top_corrector[1];
camera_top[2] = camera_top_corrector[0];

// Scale from centimeters to meters
for (int i=0;i<3;i++) {
avatar_pos[i]/=100.0f;
@@ -94,10 +65,10 @@ static int trylock(const std::multimap<std::wstring, unsigned long long int> &pi
}

static const std::wstring longdesc() {
return std::wstring(L"Supports Rocket League version 1.18 without context or identity support yet."); // Plugin long description
return std::wstring(L"Supports Rocket League version 1.19 without context or identity support yet."); // Plugin long description
}

static std::wstring description(L"Rocket League (v1.18)"); // Plugin short description
static std::wstring description(L"Rocket League (v1.19)"); // Plugin short description
static std::wstring shortname(L"Rocket League"); // Plugin short name

static int trylock1() {

0 comments on commit ff09c04

Please sign in to comment.
You can’t perform that action at this time.