Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
miscmods/miscfix.cpp
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
45 lines (38 sloc)
954 Bytes
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
| #include "windows.h" | |
| #include <stdint.h> | |
| typedef uintptr_t uintptr; | |
| #include "MemoryMgr.h" // take from skygfx_vc | |
| typedef uint8_t uint8, uchar; | |
| typedef uint16_t uint16, ushort; | |
| typedef uint32_t uint32, uint; | |
| typedef uint64_t uint64; | |
| typedef int8_t int8; | |
| typedef int16_t int16; | |
| typedef int32_t int32; | |
| typedef int64_t int64; | |
| #define nil NULL | |
| #define FIELD(type, var, offset) *(type*)((uint8*)var + offset) | |
| int gtaversion = -1; | |
| void | |
| patchIII10(void) | |
| { | |
| // ignore txd.img | |
| InjectHook(0x48C12E, 0x48C14C, PATCH_JUMP); | |
| // increase range of ped/car density | |
| static float pedMax = 100.0f; | |
| static float carMax = 100.0f; | |
| Patch(0x59BE9F + 2, &pedMax); | |
| Patch(0x59BEB1 + 2, &pedMax); | |
| Patch(0x59BF16 + 2, &carMax); | |
| Patch(0x59BF28 + 2, &carMax); | |
| } | |
| BOOL WINAPI | |
| DllMain(HINSTANCE hInst, DWORD reason, LPVOID) | |
| { | |
| if(reason == DLL_PROCESS_ATTACH){ | |
| AddressByVersion<uint32_t>(0, 0, 0, 0, 0, 0); | |
| if (gtaversion == III_10) | |
| patchIII10(); | |
| } | |
| return TRUE; | |
| } |