-
-
Notifications
You must be signed in to change notification settings - Fork 464
Add setElementCollidableWith server-side #4101
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?
Changes from 2 commits
c709597
97171c1
1ba901f
7a48afd
f72b484
dd1f6a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,7 @@ void CElementRPCs::LoadFunctions() | |
AddHandler(SET_PROPAGATE_CALLS_ENABLED, SetCallPropagationEnabled, "setCallPropagationEnabled"); | ||
AddHandler(SET_COLPOLYGON_HEIGHT, SetColPolygonHeight, "setColShapePolygonHeight"); | ||
AddHandler(SET_ELEMENT_ON_FIRE, SetElementOnFire, "setElementOnFire"); | ||
AddHandler(SET_ELEMENT_COLLIDABLE_WITH, SetElementCollidableWith, "setElementCollidableWith"); | ||
} | ||
|
||
#define RUN_CHILDREN_SERVER(func) \ | ||
|
@@ -765,3 +766,15 @@ void CElementRPCs::SetElementOnFire(CClientEntity* pSource, NetBitStreamInterfac | |
{ | ||
pSource->SetOnFire(bitStream.ReadBit()); | ||
} | ||
|
||
void CElementRPCs::SetElementCollidableWith(CClientEntity* pSource, NetBitStreamInterface& bitStream) | ||
{ | ||
ElementID ElementID; | ||
bool bCollidable; | ||
|
||
bitStream.Read(ElementID); | ||
bitStream.ReadBit(bCollidable); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bitStream.Read can return false There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It cannot. The protocol guarantees that the message is fully received. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
So what is the purpose of this function being a bool, and why does most of the code check if it returns true? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code == documentation |
||
|
||
CClientEntity* pCollidableWith = CElementIDs::GetElement(ElementID); | ||
Proxy-99 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
pSource->SetCollidableWith(pCollidableWith, bCollidable); | ||
Proxy-99 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} |
Uh oh!
There was an error while loading. Please reload this page.