Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/III.VC.SA.LimitAdjuster.ini
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ WeaponModels = unlimited
OutsideWorldWaterBlocks = 40
Coronas = 5000
FrameLimit = 30
CollisionSize = 1024
MemoryAvailable = 30%

[GTA3LIMITS]
Expand Down Expand Up @@ -244,5 +245,8 @@ DebugTextKey = 0x74 ; F5 -- Use an VKEY (see http://msdn.microsoft.com/pt-br/li
; The value can be in percent if you append a '%' at the end of the number, in this situation it'll use this percentage of memory
; from the amount of physical memory available in your system.
;
; ### CollisionSize
; Maximum size of a single collision model (.col file, 1M = 1024kb)
;
;
;
20 changes: 20 additions & 0 deletions src/limits/Misc/CollisionSize.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include "LimitAdjuster.h"

using namespace injector;

class CollisionSizeVC : public SimpleAdjuster
{
public:
const char* GetLimitName() { return GetGVM().IsVC() ? "CollisionSize" : nullptr; }
void ChangeLimit(int, const std::string& value)
{
// Collision size is stored in bytes, so we need to convert the input value to bytes.
int size = std::stoi(value) * 1024;
char* colbuf = new char[size]();

WriteMemory(0x0048AAFB + 1, colbuf, true);
WriteMemory(0x0048AB30 + 1, colbuf, true);
WriteMemory(0x0048AB60 + 1, colbuf, true);

}
} CollisionSizeVC;