-
-
Notifications
You must be signed in to change notification settings - Fork 451
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?
Conversation
bitStream.Read(ElementID); | ||
bitStream.ReadBit(bCollidable); |
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.
bitStream.Read can return false
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.
It cannot. The protocol guarantees that the message is fully received.
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.
It cannot. The protocol guarantees that the message is fully received.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Code == documentation
It has sense on the server side. The client reads server packets only.
Checks on client could be used to add a new data to a packet without increasing bitstream version, i think
The function doesn't work for a new connected players and after reconnect |
if (collidableWith == nullptr) // validity check | ||
return; |
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.
if (!collidableWith)
return;
What packet file should I write the info? |
I think you should store informations on the server side and then send it in the CMapInfoPacket. Check how it's done, for example, with setJetpackWeaponEnabled (CGame::SetJetpackWeaponEnabled & CGame::GetJetpackWeaponEnabled) |
#3681
test code