Skip to content
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

setWaterLevel: add bIncludeWorldSeaLevel and bIncludeOutsideWorldLevel #1402

Merged
merged 15 commits into from
Nov 3, 2020

Conversation

TheNormalnij
Copy link
Member

@TheNormalnij TheNormalnij commented Apr 22, 2020

This PR makes it possible to change the water level outside the game world.

New syntax:

bool setWaterLevel ( float level [, bool includeWaterFeatures = true, bool includeWaterElements = true, bool includeWorldSea = true, bool includeOutsideWorld = false ] )

Reopened #1342 #889

@qaisjp qaisjp added this to the 1.6 milestone Apr 22, 2020
@patrikjuvonen patrikjuvonen added the enhancement New feature or request label Apr 24, 2020
Comment on lines +752 to +758
for (DWORD i = 0; i < NUM_DefWaterVertices; i++)
{
m_Vertices[i].GetPosition(vecVertexPos);
if ((bIncludeWorldNonSeaLevel && m_Vertices[i].IsWorldNonSeaLevel()) || (bIncludeWorldSeaLevel && !m_Vertices[i].IsWorldNonSeaLevel()))
vecVertexPos.fZ = fLevel;
m_Vertices[i].SetPosition(vecVertexPos, pChangeSource);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure what's the type of m_Vertices, but Im pretty sure you could use a for based range loop (eg.: for(auto& vertex : m_Vertices)

Copy link
Member Author

Choose a reason for hiding this comment

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

NUM_DefWaterVertices is constant value, I think that i will leave this.

@Pirulax
Copy link
Contributor

Pirulax commented Jul 2, 2020

Seems okay to me.

Co-authored-by: Nikita Obrekht <obrekht@gmail.com>
@StrixG StrixG self-requested a review October 25, 2020 16:45
@StrixG StrixG changed the title setWaterLevel: added bIncludeWorldSeaLevel and bIncludeOutsideWorldLevel setWaterLevel: add bIncludeWorldSeaLevel and bIncludeOutsideWorldLevel Nov 3, 2020
@StrixG StrixG merged commit 483c4d0 into multitheftauto:master Nov 3, 2020
Pirulax added a commit to Pirulax/mtasa-blue that referenced this pull request Nov 29, 2020
@TheNormalnij TheNormalnij deleted the water-level branch April 11, 2021 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants