-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
71 additions
and
61 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,34 +69,34 @@ struct OutsideWorldWaterBlocks : public SimpleAdjuster | |
ASM_OutsideWorldWaterBlocks_ret2 = lazy_pointer<0x6E6D04>::get(); | ||
} | ||
|
||
// Usage counter | ||
bool GetUsage(int, std::string& output) | ||
{ | ||
int max = HasPatched()? LIMIT_OutsideWorldWaterBlocks : ReadMemory<char>(0x6E6CE9 + 2, true); | ||
return Adjuster::GetUsage(output, ReadMemory<int>(0xC215EC), max); | ||
} | ||
|
||
// Frees the current outside world water block array | ||
void Free() | ||
{ | ||
if(this->a) | ||
{ | ||
delete[] a; | ||
this->a = nullptr; | ||
} | ||
} | ||
|
||
// Reallocates the outside world water block array | ||
uint16_t* ReAlloc(int limit) | ||
{ | ||
this->Free(); | ||
return (this->a = new uint16_t[limit * 2]); | ||
} | ||
|
||
bool HasPatched() | ||
{ | ||
return this->a != nullptr; | ||
} | ||
// Usage counter | ||
bool GetUsage(int, std::string& output) | ||
{ | ||
int max = HasPatched()? LIMIT_OutsideWorldWaterBlocks : ReadMemory<char>(0x6E6CE9 + 2, true); | ||
return Adjuster::GetUsage(output, ReadMemory<int>(0xC215EC), max); | ||
} | ||
|
||
// Frees the current outside world water block array | ||
void Free() | ||
{ | ||
if(this->a) | ||
{ | ||
delete[] a; | ||
this->a = nullptr; | ||
} | ||
} | ||
|
||
// Reallocates the outside world water block array | ||
uint16_t* ReAlloc(int limit) | ||
{ | ||
this->Free(); | ||
return (this->a = new uint16_t[limit * 2]); | ||
} | ||
|
||
bool HasPatched() | ||
{ | ||
return this->a != nullptr; | ||
} | ||
|
||
// Instantiate the adjuster on the global scope | ||
} adjuster_OutsideWorldWaterBlocks; | ||
|
@@ -132,40 +132,50 @@ class OutsideWorldWaterBlocksVC : public SimpleAdjuster | |
//Author: xanser | ||
//e-mail: [email protected] | ||
public: | ||
const char* GetLimitName() { return GetGVM().IsVC() ? "OutsideWorldWaterBlocks" : nullptr; } | ||
void ChangeLimit(int, const std::string& value) | ||
{ | ||
BYTE * WaterRender = (BYTE *)0x5C1710; // функция рендера воды | ||
if (*WaterRender == 0xDE) WaterRender += 0x20; // VC 1.1 | ||
BYTE WaterLines = std::stoi(value); // количество линий внешней воды 5 | ||
// *(float *)0x69CC58 = 0; // сдвиг всей воды на запад 400 | ||
*(float *)0x69CD7C = 10000; // радиус видимости внутренней воды ниже 60 метров (z-15)*800*0.022+1200 | ||
*(float *)0x69CD80 = 10000; // радиус видимости внутренней воды выше 60 метров 2000 | ||
*(float *)0x69CDCC = static_cast<float>(WaterLines * 256); // сдвиг на количество внешней воды 1280 = 5*256 | ||
injector::WriteMemory<unsigned char>(WaterRender + 0xDC1, WaterLines, true); // количество внешней воды севера и юга | ||
injector::WriteMemory<unsigned char>(WaterRender + 0xDCB, (WaterLines - 5) * 2 + 26, true); // расширение внешней воды севера и юга на восток | ||
injector::WriteMemory<unsigned char>(WaterRender + 0xDD3, WaterLines, true); // сдвиг внешней воды запада и востока на север | ||
injector::WriteMemory<unsigned char>(WaterRender + 0x11D1, WaterLines, true); // количество внешней воды запада и востока | ||
injector::WriteMemory<unsigned char>(WaterRender + 0x11DB, WaterLines + 16, true); // расширение внешней воды запада и востока на север | ||
} | ||
const char* GetLimitName() { return GetGVM().IsVC() ? "OutsideWorldWaterBlocks" : nullptr; } | ||
void ChangeLimit(int, const std::string& value) | ||
{ | ||
uint8_t * WaterRender = (uint8_t *)0x5C1710; // функция рендера воды | ||
uint8_t WaterLines = std::stoi(value); // количество линий внешней воды 5 | ||
if (WaterLines > 40) | ||
WaterLines = 40; | ||
// *(float *)0x69CC58 = 0; // сдвиг всей воды на запад 400 | ||
*(float *)0x69CD7C = 10000.0f; // радиус видимости внутренней воды ниже 60 метров (z-15)*800*0.022+1200 | ||
*(float *)0x69CD80 = 10000.0f; // радиус видимости внутренней воды выше 60 метров 2000 | ||
*(float *)0x69CDCC = static_cast<float>(WaterLines * 256); // сдвиг на количество внешней воды 1280 = 5*256 | ||
|
||
injector::WriteMemory<uint8_t>(WaterRender + 0xDC1, WaterLines, true); // количество внешней воды севера и юга | ||
injector::WriteMemory<uint8_t>(WaterRender + 0xDCB, (WaterLines - 5) * 2 + 26, true); // расширение внешней воды севера и юга на восток | ||
injector::WriteMemory<uint8_t>(WaterRender + 0xDD3, WaterLines, true); // сдвиг внешней воды запада и востока на север | ||
injector::WriteMemory<uint8_t>(WaterRender + 0x11D1, WaterLines, true); // количество внешней воды запада и востока | ||
injector::WriteMemory<uint8_t>(WaterRender + 0x11DB, WaterLines + 16, true); // расширение внешней воды запада и востока на север | ||
|
||
injector::WriteMemory(0x5C22DE, 0x78D658, true); | ||
injector::WriteMemory(0x5C24AE, 0x78D658, true); | ||
injector::WriteMemory(0x5C26DE, 0x78D658, true); | ||
injector::WriteMemory(0x5C28BE, 0x78D658, true); | ||
} | ||
} OutsideWorldWaterBlocksVC; | ||
|
||
/////////////////////////////////////////////GTA 3///////////////////////////////////////////////////// | ||
class OutsideWorldWaterBlocksIII : public SimpleAdjuster | ||
{ | ||
public: | ||
const char* GetLimitName() { return GetGVM().IsIII() ? "OutsideWorldWaterBlocks" : nullptr; } | ||
void ChangeLimit(int, const std::string& value) | ||
{ | ||
unsigned int WaterCount = std::stoi(value); | ||
|
||
injector::WriteMemory<float>(0x602AE8, 10000.0f, true); | ||
injector::WriteMemory<float>(0x602AF0, 10000.0f, true); | ||
injector::WriteMemory<float>(0x602B48, static_cast<float>(WaterCount)* 256.0f, true); | ||
injector::WriteMemory<unsigned char>(0x5564BD + 0x2, static_cast<unsigned char>(WaterCount), true); | ||
injector::WriteMemory<unsigned char>(0x5C24D9 + 0x3, (static_cast<unsigned char>(WaterCount)-5) * 2 + 26, true); | ||
injector::WriteMemory<unsigned char>(0x5564D0 + 0x1, static_cast<unsigned char>(WaterCount), true); | ||
injector::WriteMemory<unsigned char>(0x55676D + 0x2, static_cast<unsigned char>(WaterCount), true); | ||
injector::WriteMemory<unsigned char>(0x556777 + 0x2, static_cast<unsigned char>(WaterCount)+16, true); | ||
} | ||
const char* GetLimitName() { return GetGVM().IsIII() ? "OutsideWorldWaterBlocks" : nullptr; } | ||
void ChangeLimit(int, const std::string& value) | ||
{ | ||
uint8_t WaterLines = std::stoi(value); // количество линий внешней воды 5 | ||
if (WaterLines > 40) | ||
WaterLines = 40; | ||
|
||
*(float *)0x602AE8 = 10000.0f; // радиус видимости внутренней воды ниже 60 метров (z-15)*800*0.022+1200 | ||
*(float *)0x602AF0 = 10000.0f; // радиус видимости внутренней воды выше 60 метров 2000 | ||
*(float *)0x602B48 = static_cast<float>(WaterLines * 256); // сдвиг на количество внешней воды 1280 = 5*256 | ||
|
||
injector::WriteMemory<uint8_t>(0x5564BF, WaterLines, true); // количество внешней воды севера и юга | ||
injector::WriteMemory<uint8_t>(0x5564C9, (WaterLines - 5) * 2 + 26, true); // расширение внешней воды севера и юга на восток | ||
injector::WriteMemory<uint8_t>(0x5564D1, WaterLines, true); // сдвиг внешней воды запада и востока на север | ||
injector::WriteMemory<uint8_t>(0x55676F, (WaterLines - 5) * 2 + 26, true); // количество внешней воды запада и востока | ||
injector::WriteMemory<uint8_t>(0x556779, (WaterLines - 5) * 2 + 26, true); // расширение внешней воды запада и востока на север | ||
} | ||
} OutsideWorldWaterBlocksIII; |