mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 15:50:20 +00:00
Fix underground spawns in Stormwind, redesign delete character button
Spawn fix: floor probe used terrain height (underground) instead of server position when searching for spawn floor. Now probes from max(terrain, serverZ) so WMO city surfaces above terrain are found correctly. Also invalidates floor cache on respawn. Delete button: moved from details panel to bottom row (small, red, far right). Two-stage confirmation with modal popups: first asks "are you sure", second warns "THIS CANNOT BE UNDONE" with red DELETE PERMANENTLY button.
This commit is contained in:
parent
6516fd777d
commit
fd64ca7445
3 changed files with 82 additions and 27 deletions
|
|
@ -1051,12 +1051,14 @@ void CameraController::reset() {
|
|||
if (terrainManager) {
|
||||
terrainH = terrainManager->getHeightAt(x, y);
|
||||
}
|
||||
float floorProbeZ = terrainH.value_or(refZ);
|
||||
// Probe from the highest of terrain, refZ (server position), and defaultPosition.z
|
||||
// so we don't miss WMO floors above terrain (e.g. Stormwind city surface).
|
||||
float floorProbeZ = std::max(terrainH.value_or(refZ), refZ);
|
||||
if (wmoRenderer) {
|
||||
wmoH = wmoRenderer->getFloorHeight(x, y, floorProbeZ + 2.0f);
|
||||
wmoH = wmoRenderer->getFloorHeight(x, y, floorProbeZ + 4.0f);
|
||||
}
|
||||
if (m2Renderer) {
|
||||
m2H = m2Renderer->getFloorHeight(x, y, floorProbeZ + 2.0f);
|
||||
m2H = m2Renderer->getFloorHeight(x, y, floorProbeZ + 4.0f);
|
||||
}
|
||||
auto h = selectReachableFloor(terrainH, wmoH, refZ, 16.0f);
|
||||
if (!h) {
|
||||
|
|
@ -1177,6 +1179,10 @@ void CameraController::reset() {
|
|||
lastGroundZ = spawnPos.z - 0.05f;
|
||||
}
|
||||
|
||||
// Invalidate inter-frame floor cache so the first frame probes fresh.
|
||||
cachedFloorHeight.reset();
|
||||
cachedFloorPos = glm::vec2(0.0f);
|
||||
|
||||
camera->setRotation(yaw, pitch);
|
||||
glm::vec3 forward3D = camera->getForward();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue