-
Notifications
You must be signed in to change notification settings - Fork 12
Implement mmNetObject::Predict #171
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
base: master
Are you sure you want to change the base?
Conversation
First draft. Not sure about the constant (name). The first `ARTSPTR->GetUpdateDelta()` could be put directly in the function call if you prefer.
At the moment there are still some compiler errors related to unresolved external symbols.
code/midtown/mmgame/netobject.cpp
Outdated
| : asNetObject() | ||
| , field_28(0) | ||
| , Flags(0) | ||
| , Score(0) | ||
| , Time(0.0f) | ||
| , LocalData {} | ||
| , Car(nullptr) | ||
| , IsEnabled(false) | ||
| , Active(0) | ||
| , UpdateCount(0) | ||
| , MatrixChanged(false) | ||
| , ActivateTime(0.0f) | ||
| , Steering(0.0f) | ||
| , PrevSteering(0.0f) | ||
| , SteeringDelta(0.0f) | ||
| , Throttle(0.0f) | ||
| , PrevThrottle(0.0f) | ||
| , ThrottleDelta(0.0f) | ||
| , Brakes(0.0f) | ||
| , PrevBrakes(0.0f) | ||
| , BrakesDelta(0.0f) | ||
| , field_BC(0.0f) | ||
| , field_C0(0.0f) | ||
| , Matrix(IDENTITY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these members can be directly initialized as part of the member's declaration. Also, you don't need to explicitly call the base classes default constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KcRobin9 you still need to initialize these members, I just mean you can do it as part of the declaration, i.e field_28 {} (for any "default" values false/0/0.0f/nullptr you can use empty brackets rather than i.e field_28 {0}.
Also you still need to have a constructor to reset time_delta since that's not a member.
code/midtown/mmgame/netobject.cpp
Outdated
| return; | ||
|
|
||
| LocalData.SenderId = PlayerID; | ||
| LocalData.MessageId = 501; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you create an enum for the IDs?
First draft.
Not sure about the constant (name).
The first
ARTSPTR->GetUpdateDelta()could be put directly in the function call if you prefer.