From d9923779c863ef6976e7d4dcd9315b8564a9f23d Mon Sep 17 00:00:00 2001 From: Petr Ohlidal Date: Mon, 24 Jun 2024 00:34:05 +0200 Subject: [PATCH] :bug: Fixed 'L' not locking slidenodes. PROBLEM: typo (a copypaste derp) in GameContext.cpp ADDITIONAL FIX: an assert() when loading Penguinville-TrolleyLine terrain. The blendmap info was incomplete (understandable since the terrain is meshed-only) and the game ended up reading bad memory. Fixed by adding a check for valid data which reports "[RoR|Terrain] Page {}-{} has no blend layers defined, blendmap will not be set up." to RoR.log. --- source/main/GameContext.cpp | 2 +- source/main/terrain/TerrainGeometryManager.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/source/main/GameContext.cpp b/source/main/GameContext.cpp index 076e5993a9..4a6dea7a41 100644 --- a/source/main/GameContext.cpp +++ b/source/main/GameContext.cpp @@ -1374,7 +1374,7 @@ void GameContext::UpdateCommonInputEvents(float dt) //m_player_actor->toggleSlideNodeLock(); ActorLinkingRequest* slidenode_rq = new ActorLinkingRequest(); slidenode_rq->alr_type = ActorLinkingRequestType::SLIDENODE_TOGGLE; - hook_rq->alr_actor_instance_id = m_player_actor->ar_instance_id; + slidenode_rq->alr_actor_instance_id = m_player_actor->ar_instance_id; App::GetGameContext()->PushMessage(Message(MSG_SIM_ACTOR_LINKING_REQUESTED, slidenode_rq)); } diff --git a/source/main/terrain/TerrainGeometryManager.cpp b/source/main/terrain/TerrainGeometryManager.cpp index 9c6599f23c..882efef823 100644 --- a/source/main/terrain/TerrainGeometryManager.cpp +++ b/source/main/terrain/TerrainGeometryManager.cpp @@ -550,6 +550,13 @@ void TerrainGeometryManager::SetupBlendMaps(OTCPage& page, Ogre::Terrain* terrai { const int layerCount = terrain->getLayerCount(); auto layer_def_itor = page.layers.begin(); + + if (page.layers.size() < 2) + { + LOG(fmt::format("[RoR|Terrain] Page {}-{} has no blend layers defined, blendmap will not be set up.", page.pos_x, page.pos_z)); + return; + } + ++layer_def_itor; for (int i = 1; i < layerCount; i++) {