-
Notifications
You must be signed in to change notification settings - Fork 5
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
Human:getVehicleSeat() could returns nil instead of -1 #113
Comments
Doesn't it return -1 in the original game's lua too? I know it does in Mafia 2. |
This is a very interesting remark that I often ask myself, should we be similar to the behavior and naming of the original Mafia code or make it as clear as possible for the end user in the sdk layer? cc @zpl-zak @Segfaultd |
I'd split the function to two, one providing Seat index (or -1 if empty), other a valid Human object (or nil in case it's empty). |
Agree with @zpl-zak. If the function expected outcome is an index, then |
So not applicable then. Can I close the issue? |
I'd keep it open since I feel it would be beneficial to split this method. User might want to access the Human object directly, which this method does not provide. I envision having this method renamed to something like |
Ok for the renaming to Howerver, I don't understand the role of the second function? |
oh yea sorry, something like that would work, yes. |
Description
When the player is not in a vehicle, could we return nil instead of -1?
MafiaMP/code/server/src/core/builtins/human.cpp
Lines 45 to 52 in b4dfb16
What do you think about it?
Reproduction
When not in vehicle, connected to a server, type
/seat
in chatThe text was updated successfully, but these errors were encountered: