fivem icon indicating copy to clipboard operation
fivem copied to clipboard

feat(extra-natives/five): CScenarioConditionIsMultiplayerGame network check patch

Open z3t4s opened this issue 2 years ago • 3 comments

This was talked about in the CW discord and also formally requested in the forums.

It patches a virtual function inside the 'CScenarioConditionIsMultiplayerGame' vtable to allow a few CConditionalClipset's to execute in networked environments. This seems to be exclusively used for alternative car entry/exit/jacking animations (a different condition called 'CScenarioConditionIsPlayerInMultiplayerGame' is used in other places for conditional animations and scenarios)

Note: This has been tested with two clients on 1604-2802 Debug and Release. This was the best pattern possible due to the generic layout of the check function, the ctor of the vft and the 'parser_Register' function

z3t4s avatar Aug 20 '23 20:08 z3t4s

Force pushed to include the count_hint optimization

z3t4s avatar Aug 23 '23 23:08 z3t4s

So I assume this is going to allow MP characters do specific animations that they can't do in FiveM but can do in story? If so then that is pretty sweet and a much needed feature!

Rm1998 avatar Oct 25 '23 10:10 Rm1998

I have noticed strange behaviour when trying to hijack remote vehicles (and drivers). While I have not fully debugged this, it does seem dependent on when the migration to the client doing the hijacking happens.

Likely some task data being reset or not synchronized. This leads to a desynchronization between as one client will have the Ped in the driver seat and another client will not (executing a flee or motion task, iirc). The video you once shared in the Codewalker discord exhibited this behaviour slightly as well. Debugging this without OneSync may allow finer control over specific migration issues.

If this edge-case gets solved, since we don't do anything w/ NDEBUG it would be nice if that assert would be wrapped in #ifdef _DEBUG. Given the nature of this changes, this is a really nice add.

gottfriedleibniz avatar Mar 21 '24 19:03 gottfriedleibniz