Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show a warning if a script modifies a non-joined player #145

Merged

Conversation

Necktrox
Copy link
Contributor

@Necktrox Necktrox added the bug Something isn't working label May 28, 2017
@qaisjp
Copy link
Contributor

qaisjp commented May 30, 2017

Instead of adding VerifyPlayerIsJoinedUsage into every method in the Player -> Ped -> Element tree, would it be possible to inject it?

The fact that almost all element/ped/player Lua functions are in their own class should make this easier.

Also, perhaps rename VerifyPlayerIsJoinedUsage to VerifyPlayerJoined or CheckPlayerJoined?

@Necktrox
Copy link
Contributor Author

Not every method changes the CPlayer (e. g. all the GetPlayerFoo) - I checked all the methods to be sure and only included the call in the methods, which actually modify the player.

A function name should be clear and tell what it does without looking into the code. My added function checks if the element is a player and if the player has joined the game (isJoined). I have nothing against changing the name, because I don't really like the name, but it should include "Print" and/or "Warn".

@qaisjp
Copy link
Contributor

qaisjp commented May 30, 2017 via email

@qaisjp
Copy link
Contributor

qaisjp commented Jul 2, 2017

@Necktrox feel free to merge this if you've tested it 👍

@Necktrox Necktrox force-pushed the fix/player-is-joined-warning branch from 48747cf to 367ec74 Compare July 3, 2017 15:40
@Necktrox Necktrox merged commit fa50dcf into multitheftauto:master Jul 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants