gta-reversed / gta-reversed-modern Goto Github PK
View Code? Open in Web Editor NEWReimplementation of GTA:SA 1.0 US
Reimplementation of GTA:SA 1.0 US
Describe the bug
There are a few classes that originally overwrote ProcessEntityCollision
, yet we don't (which causes issues).
I've fixed CAutomobile
in 11ed5a7, but there are still a few classes that don't override it. (CTrailer, CBoat, etc)
To Reproduce
See original VTables
Describe the bug
Right now classes with a c/dtor that isn't reversed will be double con/destructed, because when our ctor is called we call the original ctor, and then compiler will con/destruct all members over again.
To Reproduce
CPed is a good example: It has no reversed dtor. If one would add it, and just plugin::Call
the original one they would experience a crash (likely in CMatrixLink
)
Expected behavior
All classes with an c/dtor that hasn't been reversed should get reversed.
Additional context
Fixing this may fix quite some random issues.
I'm not sure, but I think it started happening 1-2 weeks ago.
Unsure what causes it, in the video I've tired:
Let's use floor
, otherwise the compiler will complain:
float width = std::floor(SCREEN_WIDTH_UNIT * 8.f);
float height = std::floor(SCREEN_HEIGHT_UNIT * 8.f);
Originally posted by @Pirulax in https://github.com/Updated-Classic/gta-reversed-modern/pull/93#discussion_r790186207
Can't play missions (duh) and start a new game.
Faulty func: CClothes::RebuildCutscenePlayer
Faulty func: CWorld::SprayPaintWorld
Most notably:
GetPosition
, etc)CTask
's GetTaskType
Post all random crashes here, using the bug report template.
AddMovingEntityPtr
(because numVisibleEntityPtrs
is too high)Also maybe CRenderer::AddEntityToRenderList
is wrong.
Try hook/unhook CRenderer::ScanBigBuildingList
several time and bug will apear.
Right now it's only possible to search by class name, but not by function name.
I propose the following format:
<namespace (class)>
::<function name>
::
(without anything before ::
)::
or there's nothing after it we just filter the namespace listEg.:
CWorld::Process
- Should yield CWorld
with all functions whose name starts with Process
::Process
- All functions starting with Process
Process::
- All functions inside the Process
class/namespaceEntity/::
- All functions inside the Entity category (Note the trailing /
at the end - It is needed to differentiate between a class and category)Entity/Ped::
- Similar to above, but only show functions inside the Entity/Ped
category.Entity::
- All functions inside the Entity
classFor now this should be enough, in another PR fuzzy search could be added, to make stuff like:
World::Process
-> Would display all classes which contain the word "Word" and have a function whose name contains Process
The CStreaming::DeleteRwObjectsInSectorList
crashes because entity
is nullptr
.
thats a 2D table, hence the multiply by 2.
constexpr struct {AnimationId animId; AssocGroupId assoc; } translation[] = {...};
(originally it was prob uint32[2][]
I'd recommend you use the struct method for clarity.
Also, the table seems to start at a lower address than IDA thinks (because 2 * 0 - 1 = -1
).
Originally posted by @Pirulax in https://github.com/Updated-Classic/gta-reversed-modern/pull/29#discussion_r699641175
I'm curious how long it might be before there is a standalone executable at the rate this project is moving? Further, once it does reach a complete state where it matches the original in function, would this project then start working on adding new features on top of the game? Like say optimizing it, fixing bugs, adding a few tweaks, and maybe custom textures and sounds to replace the original?
It should be similar to RH_ScopedInstall
, but it should take the address of the _Reversed
function instead.
Eg.: RH_ScopedVirtualInstall(GetTaskType, 0xdeadbeef)
Should expand to something like InstallHook("ClassName", "GetTaskType", &GetTaskType_Reversed)
Adding this macro will get rid of the ugly _Reversed
prefix in the GUI.
It would be really useful, because std::array
has bound checking in debug mode, and it would help us in debugging a lot.
It has the same memory layout as a C-style array, so they're interchangeable.
ScanBigBuildingList
causes a crash because it tries to add to many entities to the render list using AddEntityToRenderList
(which is where it actually crashes, because ms_nNoOfVisibleEntities
is incremented to some absurdly high value).
Unhooking it fixes the problem.
Describe the bug
Game still rings the phone for a frame-perfect time then dismiss while using a jetpack. Phone shouldn't ring at the first place.
To Reproduce
Steps to reproduce the behavior:
Additional context
(took a while to catch the perfect frame ๐)
Faulty func: CPhysical::???
(also punching bags after unhooked ApplyForce
crashes the game)
Describe the bug
Incorrect fall animation.
To Reproduce
Steps to reproduce the behavior:
FindPlayerPed()->GetPosition() += { 0.0f, 0.0f, 2000.f };
CWorld::SprayPaintWorld
. (#109)Faulty func: CWorld::ClearExcitingStuffFromArea
Here's a list of stuff we gotta fix:
CWaterCannon
(For whatever reason cannons are stuck in the air shooting water when a new game/save is loaded) #113CStats::FindMaxNumberOfGroupMembers
crashes the game while recruiting - Only crashes for @yukaniCColStore::AddRef
and CColStore::RemoveRef
(see funcs)CAutomobile
Faulty func: CWorld::SprayPaintWorld
I'm playing in windowed mode, but when I wanna switch to fullscreen by pressing alt
+enter
game is crashing.
An option to "lock" hooks would be nice (that is, the hook's state can't be changed from the GUI).
Would be very useful in situations like #220 where we want to install hooks which always unhooked.
Instead of our asi we get imgui.
Faulty func: CDamageManager::GetWheelStatus
Describe the bug
The task pool (eg.: CPool
) is full after some chasing by cops. Now, I'm not sure if it's because I was in a Rhino, but I'm pretty sure the vanilla game doesnt crash even when youre chased by the police in a Rhino.
From the video you can see I crash when there's a lot of stuff going on around me. I guess that's related as well.
To Reproduce
Expected behavior
To not crash xddd
Screenshots
I'll post a video
Additional context
We probably have a mem leak somewhere. Good start would be the task manager/CPedIntel
dmp here
Describe the bug
See screenshot.
To Reproduce
Walk around
Screenshots
Additional context
Most likely introduced by e898575
CTaskSimpleCarGoToPointNearDoorUntilDoorNotInUse
CTaskComplexOpenDriverDoor
CTaskComplexOpenPassengerDoor
CEntitySeekPosCalculatorDriving
CEntitySeekPosCalculatorEntitySurface
CEntitySeekPosCalculatorVehicleId
CTaskComplexSeekEntityAiming
CTaskInteriorBeInHouse
CTaskInteriorBeInOffice
CTaskInteriorBeInShop
CTaskInteriorGoToInfo
CTaskInteriorLieInBed
CTaskInteriorShopKeeper
CTaskInteriorSitAtDesk
CTaskInteriorSitInChair
CTaskInteriorUseInfo
CTaskSimpleCarOpenLockedDoorFromOutside
CTaskSimpleCarSetPedSlowDraggedOut
CTaskSimpleCarShuffle
CTaskSimpleCarSlowBeDraggedOut
CTaskSimpleHurtPedWithCar
CTaskSimpleKillPedWithCar
CTaskComplexHitPedWithCar
CTaskSimpleDuckToggle
- ScriptCTaskSimpleFinishBrain
- ScriptCTaskSimpleOnEscalator
CTaskSimpleSetCharIgnoreWeaponRangeFlag
CTaskSimpleSetKindaStayInSamePlace
CTaskSimpleWaitUntilLeaderAreaCodesMatch
CTaskComplexKillCriminal
CTaskComplexFollowLeaderAnyMeans
CTaskComplexFollowPatrolRoute
CTaskComplexEnterCarAsDriverTimed
CTaskComplexEnterCarAsPassengerTimed
CTaskComplexFallToDeath
CTaskComplexWalkAlongsidePed
CTaskComplexEvasiveDiveAndGetUp
CTaskComplexUseClosestFreeScriptedAttractor
CTaskComplexUseClosestFreeScriptedAttractorRun
CTaskComplexUseClosestFreeScriptedAttractorSprint
CTaskComplexUseEffect
CTaskComplexUseEffectRunning
CTaskComplexUseEffectSprinting
CTaskComplexFollowNodeRouteShooting
CTaskComplexFallAndStayDown
CTaskComplexExtinguishFireOnFoot
CTaskSimpleRunAnimLoopedMiddle
CTaskSimpleBeHitWhileMoving
CTaskSimpleChat
CTaskSimpleDuckWhileShotsWhizzing
CTaskComplexGoToPointUntilCollisionAndStandStill
CTaskComplexKillAllThreats
CTaskComplexUseAttractorPartner
CTaskComplexPresentIDToCop
CTaskComplexReactToAttack
CTaskSimpleHailTaxi
CTaskSimpleHailTaxiAndPause
CTaskComplexUseEntryExit
CTaskSimpleWaitForPizza
CTaskSimpleTriggerEvent
CTaskComplexUsePairedAttractor
This isn't really the issue of HooksModule
, it's just where it "comes out".
It's SplitStringView
being garbage (Sadly only C++23 has the required stuff that we'd need to get rid of this function).
Using tne range-constructor of string_view
(c++23) it works fine, so I'll probably do that.
Until then, don't enter such strings :D
Edit:
Actually, the fix would be this I think:
if (&*rng.begin() != str.end()) {
return std::string_view(&*rng.begin(), std::ranges::distance(rng));
} else {
return "";
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.