Decompile 2 functions in Source/Contents/Ground/GroundWaterState.cpp

Batch #15755 by Yommy: 1 byte-identical, 1 confirmed by peer review.

- fn_17580 GroundGeometry::WaterLevel: byte-identical
- fn_17581 GroundGeometry::UpdateWater: logic confirmed by peer review

Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-11-10 09:33:42 +00:00
commit 2e1a40b571

View file

@ -57,7 +57,11 @@ float GroundGeometry::WaterLevel(int column, int row) const {
const int z = std::min(row / cellHeight, this->waterRows - 1);
const unsigned index = static_cast<unsigned>(x) + static_cast<unsigned>(z) * static_cast<unsigned>(this->waterColumns);
return index < this->waterLevels.size() ? this->waterLevels[index] : 0.0f;
if (this->waterLevels.size() > index) {
return this->waterLevels[index];
}
return 0.0f;
}
// OFFSET: 0x00AC1430
@ -68,7 +72,8 @@ void GroundGeometry::UpdateWater() {
static constexpr char format[] = "워터\\water%d%02d.jpg";
char name[32]{};
for (GroundWaterSurface& surface : this->waterSurfaces) {
for (auto it = this->waterSurfaces.begin(); it != this->waterSurfaces.end(); ++it) {
GroundWaterSurface& surface = *it;
++surface.frame;
const int end = surface.animation * 32;