Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Draft
Proxy-99 wants to merge 11 commits into multitheftauto:master
base: master
Choose a base branch
Loading
from Proxy-99:setCollide

Conversation

@Proxy-99
Copy link
Contributor

@Proxy-99 Proxy-99 commented Mar 14, 2025
edited
Loading

#3681

test code

vehicle1 = createVehicle ( 411, 2044.65942, 1526.35352, 10.67188)
object = createObject( 3578, 2044.40405, 1510.24036, 10.67188)
setTimer(function()
 res = setElementCollidableWith(vehicle1,object,false)
 print(res)
end, 2000, 1)

Comment on lines 775 to 776
bitStream.Read(ElementID);
bitStream.ReadBit(bCollidable);
Copy link
Member

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

Proxy-99 reacted with thumbs up emoji
Copy link
Member

@TheNormalnij TheNormalnij Mar 14, 2025

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.

Copy link
Member

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?

Copy link
Member

@TheNormalnij TheNormalnij Mar 14, 2025

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

@Proxy-99 Proxy-99 requested a review from FileEX March 14, 2025 11:42
Copy link
Member

The function doesn't work for a new connected players and after reconnect

Proxy-99 reacted with thumbs up emoji

@Proxy-99 Proxy-99 marked this pull request as draft March 14, 2025 12:10
Comment on lines +781 to +782
if (collidableWith == nullptr) // validity check
return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (!collidableWith)
 return;

Copy link
Contributor Author

The function doesn't work for a new connected players and after reconnect

What packet file should I write the info?
is it Server\mods\deathmatch\logic\packets\CPlayerJoinCompletePacket.cpp

Copy link
Member

FileEX commented Mar 18, 2025

The function doesn't work for a new connected players and after reconnect

What packet file should I write the info? is it Server\mods\deathmatch\logic\packets\CPlayerJoinCompletePacket.cpp

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@FileEX FileEX FileEX requested changes

+1 more reviewer

@TheNormalnij TheNormalnij TheNormalnij left review comments

Reviewers whose approvals may not affect merge requirements

Requested changes must be addressed to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /