Giter Club home page Giter Club logo

gta-reversed-modern's People

Contributors

afskyy avatar amyrahmady avatar batuaksoy avatar bigbossbro08 avatar botder avatar crosroad95 avatar fcs49 avatar forkerer avatar frouk3 avatar imring avatar izzotop avatar jaapionl avatar kanux-14 avatar lex3a avatar majesticcoding avatar maxtorcoder avatar mikuauahdark avatar mrjohndev avatar pirulax avatar plakapenka avatar sociopart avatar sorpdev avatar spmn avatar temajm avatar unnunu avatar user-grinch avatar yukani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gta-reversed-modern's Issues

Fix `ProcessEntityCollision` not overridden in some classes

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

Fix double con/destruction of classes with a c/dtor that isn't reversed

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.

Game hangs in cutscenes

Can't play missions (duh) and start a new game.

Faulty func: CClothes::RebuildCutscenePlayer

Fix CClouds::MovingFogRender

Issue

How it looks like

image

How it should look like

image

Reproduce
Turn on foggy weather through debug menu.
Make sure CClouds::MovingFogRender is hooked.

Breaking door

Sometimes when entering to interior or vice versa, the door breaks.

image
image

Location
image

Fix rendering issues

  • CRenderer::ScanSectorList - Problem with alpha on the road
  • CRenderer::ScanBigBuildingList - Loop seems to go-on forever, and crashes in AddMovingEntityPtr (because numVisibleEntityPtrs is too high)
  • CVisibilityPlugins. Produces bad render while only they hooked

Also maybe CRenderer::AddEntityToRenderList is wrong.

Try hook/unhook CRenderer::ScanBigBuildingList several time and bug will apear.

Images

image
image

Add better search functionality to Hooks tool

The original idea (Refer here for the final implementation):

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>
  • Just like in C++, it's possible to refer to the global namespace by typing :: (without anything before ::)
  • If there's no :: or there's nothing after it we just filter the namespace list

Eg.:

  • 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/namespace
  • Entity/:: - 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 class

For 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

image

Fix ProcessColModels

  • Turns out Dumper uses disks... And I haven't implemented disks. (upd: Izzotop: MonsterTruck and cranes uses too)
  • Also, there seems to be some collision bug when you stick the car to a wall.

Questions

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?

Add RH_ScopedVirtualInstall

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.

ScanBigBuildingList - Crash

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.

Phone still rings while using a jetpack

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:

  1. Load the save I uploaded below.
  2. Get outside and enter the jetpack.
  3. Wait for the phone ring, this is the bug.

Additional context
vlcsnap-2022-02-12-23h05m54s289
(took a while to catch the perfect frame ๐Ÿ˜„)

GTASAsf7.zip

Sandbag physics broken

2022-02-05.20-01-48.mp4

Faulty func: CPhysical::??? (also punching bags after unhooked ApplyForce crashes the game)

CTaskSimpleInAir::ProcessPed

Describe the bug
Incorrect fall animation.

To Reproduce
Steps to reproduce the behavior:

FindPlayerPed()->GetPosition() += { 0.0f, 0.0f, 2000.f };
Video
8mb.video-TEk-5y4O688s.mp4

Fireman disappearing from firetruck

Seems to happen only the first time they come out.
Unhooking CWorld::Process doesn't help.
Possible way to trace the issue may be to hook CWorld::Remove or CPopulation::RemovePed and see where it's called from.
image

Unlock master branch

Here's a list of stuff we gotta fix:

  • #148
  • #81
  • #90
  • #91
  • Fix CWaterCannon (For whatever reason cannons are stuck in the air shooting water when a new game/save is loaded) #113
  • Test CStats::FindMaxNumberOfGroupMembers crashes the game while recruiting - Only crashes for @yukani
  • #159
  • Grass -> 0x4106D0 then both 0x538440 and 0x5B5000 - Grass not visible on models
  • Resolve bugs in CColStore::AddRef and CColStore::RemoveRef (see funcs)
  • #83
  • #103
  • #111
  • #112
  • #119
  • #117
  • #118
  • #142
  • #149
  • #121
  • #164
  • #171
  • #185
  • Fix CAutomobile
  • #272

Starting `Initial 2` mission crashes the game

Describe the bug
Starting Initial 2 mission crashes the game

To Reproduce

  1. Start the Initial 2 mission

Screenshots

image

Additional context
Crashes in CCarGenerator, this is always 0xE27AB0 (Which causes a write access violation)

Add `locked` option to ReversibleHooks

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.

Task pool gets full, makes game crash

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

  1. Take Rhino (I don't even think you need a vehicle)
  2. Make yourself Wanted thru the cheat debug menu
  3. Start running from them
  4. Crash

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

Missing stubs for classes

Car door stuff
  • CTaskSimpleCarGoToPointNearDoorUntilDoorNotInUse
  • CTaskComplexOpenDriverDoor
  • CTaskComplexOpenPassengerDoor
Seek Pos Calculator's
  • CEntitySeekPosCalculatorDriving
  • CEntitySeekPosCalculatorEntitySurface
  • CEntitySeekPosCalculatorVehicleId
  • CTaskComplexSeekEntityAiming
Simple Interior Tasks
  • CTaskInteriorBeInHouse
  • CTaskInteriorBeInOffice
  • CTaskInteriorBeInShop
  • CTaskInteriorGoToInfo
  • CTaskInteriorLieInBed
  • CTaskInteriorShopKeeper
  • CTaskInteriorSitAtDesk
  • CTaskInteriorSitInChair
  • CTaskInteriorUseInfo
CTaskSimpleCar...
  • CTaskSimpleCarOpenLockedDoorFromOutside
  • CTaskSimpleCarSetPedSlowDraggedOut
  • CTaskSimpleCarShuffle
  • CTaskSimpleCarSlowBeDraggedOut
HurtPedWithCar
  • CTaskSimpleHurtPedWithCar
  • CTaskSimpleKillPedWithCar
  • CTaskComplexHitPedWithCar
Simple Tasks
  • CTaskSimpleDuckToggle - Script
  • CTaskSimpleFinishBrain - Script
  • CTaskSimpleOnEscalator
  • CTaskSimpleSetCharIgnoreWeaponRangeFlag
  • CTaskSimpleSetKindaStayInSamePlace
  • CTaskSimpleWaitUntilLeaderAreaCodesMatch
CTaskComplexKill...
  • CTaskComplexKillCriminal
CTaskComplexFollow...
  • CTaskComplexFollowLeaderAnyMeans
  • CTaskComplexFollowPatrolRoute
CTaskComplexEnterCar...
  • CTaskComplexEnterCarAsDriverTimed
  • CTaskComplexEnterCarAsPassengerTimed
Complex Tasks
  • CTaskComplexFallToDeath
  • CTaskComplexWalkAlongsidePed
  • CTaskComplexEvasiveDiveAndGetUp
CTaskComplexUseClosestFreeScriptedAttractor...
  • CTaskComplexUseClosestFreeScriptedAttractor
  • CTaskComplexUseClosestFreeScriptedAttractorRun
  • CTaskComplexUseClosestFreeScriptedAttractorSprint
CTaskComplexUseEffect... (Needed for CTaskComplexUseClosestFreeScriptedAttractor)
  • CTaskComplexUseEffect
  • CTaskComplexUseEffectRunning
  • CTaskComplexUseEffectSprinting
Unused
  • CTaskComplexFollowNodeRouteShooting
  • CTaskComplexFallAndStayDown
  • CTaskComplexExtinguishFireOnFoot
  • CTaskSimpleRunAnimLoopedMiddle
  • CTaskSimpleBeHitWhileMoving
  • CTaskSimpleChat
  • CTaskSimpleDuckWhileShotsWhizzing
  • CTaskComplexGoToPointUntilCollisionAndStandStill
  • CTaskComplexKillAllThreats
  • CTaskComplexUseAttractorPartner
  • CTaskComplexPresentIDToCop
  • CTaskComplexReactToAttack
  • CTaskSimpleHailTaxi
  • CTaskSimpleHailTaxiAndPause
  • CTaskComplexUseEntryExit
  • CTaskSimpleWaitForPizza
  • CTaskSimpleTriggerEvent
CTaskComplexUseAttractor
  • CTaskComplexUsePairedAttractor

HooksModule: Entering "\:" then deleting ":" will cause an assert

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 "";
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.