Repository navigation
Conversation
|
Could we use LabAPI’s ReportingPlayer and ReportingCheater events here, like the existing reload adapters, to avoid relying on local variable slots? |
5804ee9 to
c4f78b5
Compare
Considering this is targeting dev, go ahead! Only condition: Our event must maintain the same functionality. If the LabAPI equivalent has some missing functionality, we can't port it. Also, leave a comment on the event regarding the status of the port (see #875) |
yeah, that will be a big work for sl 15.x update. I will leave a comment for that when I got this pr finished :) |
Description
Describe the changes
Resolve the target of
Server.LocalReportingandServer.ReportingCheaterfromplayerNetIdusingldarg.1andPlayer.Get(uint), replacing the hard-codedldloc.2andPlayer.Get(ReferenceHub).What is the current behavior?
In SCP:SL 14.2.9 server build, the target ReferenceHub is in local slot 1, but both report hooks still load slot 2, resulting in a null Target
What is the new behavior?
Player.Get(uint)uses the sameReferenceHub.TryGetHubNetIDlookup as the original method, which has already validatedplayerNetIdbefore either event runs. Both events resolve the intended player without depending on compiler-assigned local slots.The local event remains inside the
notifyGm == falsebranch; the global event remains after successful signature validation. The existingIsAllowedcancellation logic is unchanged.Does this PR introduce a breaking change?
No.
Other information
Nothing.
Types of changes
Submission checklist
Patches (if there are any changes related to Harmony patches)
Other