Skip to content

Commit

Permalink
feat: ✨ add support for warzone version 4.1.0
Browse files Browse the repository at this point in the history
Closes #18

Signed-off-by: Lucas Vieira <lucas.engen.cc@gmail.com>
  • Loading branch information
lucasvmx committed Jul 11, 2021
1 parent 6cafa29 commit 5ace3e4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

// Versão do programa
#define SPARK_MAJOR 2
#define SPARK_MINOR 2
#define SPARK_PATCH 1
#define SPARK_MINOR 3
#define SPARK_PATCH 0

/**
* @brief nome do programa
Expand Down
10 changes: 2 additions & 8 deletions src/wzhack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ unsigned short WzHack_GetWarzoneVersion(const char *wz_filename)
// Compila o número de versão para um único número
iversion = (major * 100) + (minor * 10) + patch;

if((iversion > WZ_401) || (iversion < WZ_239))
if((iversion > WZ_410) || (iversion < WZ_239))
iversion = WZ_UNKNOWN;

if (buf)
Expand Down Expand Up @@ -398,13 +398,7 @@ uint32_t GetWarzoneMaxPowerValue(int warzone_version)
{
case WZ_239:
return 100000;
case WZ_315:
case WZ_323:
case WZ_330:
case WZ_340:
case WZ_341:
case WZ_400:
case WZ_401:
default:
return 1000000;
}

Expand Down
19 changes: 17 additions & 2 deletions src/wzhack.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#define WZ_341 341
#define WZ_400 400
#define WZ_401 401
#define WZ_410 410
#define WZ_UNKNOWN 0xFFF

// Retorna o número de elementos de um array 2D
Expand Down Expand Up @@ -100,7 +101,8 @@ static const struct game_status gstatus[] =
{
{ 0x3b1b88, 0x39ce38, WZ_341 },
{ 0x51a7c8, 0x5058f0, WZ_400 },
{ 0x51a7c8, 0x5058f0, WZ_401}
{ 0x51a7c8, 0x5058f0, WZ_401 },
{ 0x55b300, 0x5463b0, WZ_410 }
};

// power_offset + max_power_offset = energia máxima
Expand Down Expand Up @@ -210,7 +212,20 @@ static const struct player player_info[] =
{7, 0, 0, 0, 0x920834, 0, 0, 0, 0, 0, WZ_401},
{8, 0, 0, 0, 0x920864, 0, 0, 0, 0, 0, WZ_401},
{9, 0, 0, 0, 0x920894, 0, 0, 0, 0, 0, WZ_401},
{10, 0, 0, 0, 0x9208c4, 0, 0, 0, 0, 0, WZ_401}
{10, 0, 0, 0, 0x9208c4, 0, 0, 0, 0, 0, WZ_401},

// Warzone 2100 4.1.0
{0, 0, 0, 0, 0x9610e4, 0, 0, 0, 0, 0, WZ_410},
{1, 0, 0, 0, 0x961114, 0, 0, 0, 0, 0, WZ_410},
{2, 0, 0, 0, 0x961144, 0, 0, 0, 0, 0, WZ_410},
{3, 0, 0, 0, 0x961174, 0, 0, 0, 0, 0, WZ_410},
{4, 0, 0, 0, 0x9611a4, 0, 0, 0, 0, 0, WZ_410},
{5, 0, 0, 0, 0x9611d4, 0, 0, 0, 0, 0, WZ_410},
{6, 0, 0, 0, 0x961204, 0, 0, 0, 0, 0, WZ_410},
{7, 0, 0, 0, 0x961234, 0, 0, 0, 0, 0, WZ_410},
{8, 0, 0, 0, 0x961264, 0, 0, 0, 0, 0, WZ_410},
{9, 0, 0, 0, 0x961294, 0, 0, 0, 0, 0, WZ_410},
{10, 0, 0, 0, 0x9612c4, 0, 0, 0, 0, 0, WZ_410}
};

/**
Expand Down

0 comments on commit 5ace3e4

Please sign in to comment.