Skip to content

Commit

Permalink
🐛 Fixed 'L' not locking slidenodes.
Browse files Browse the repository at this point in the history
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 game 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.
  • Loading branch information
ohlidalp committed Jun 23, 2024
1 parent 58520dd commit c047902
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion source/main/GameContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down
7 changes: 7 additions & 0 deletions source/main/terrain/TerrainGeometryManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
{
Expand Down

0 comments on commit c047902

Please sign in to comment.