Skip to content

Commit

Permalink
Fixed Clear Sky upgrades (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Oct 15, 2021
1 parent e2ef829 commit 2f9bbe5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
13 changes: 10 additions & 3 deletions src/xrGame/inventory_upgrade_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,16 @@ UpgradeStateResult Group::can_install(CInventoryItem& item, UpgradeBase& test_up
{
continue;
}
// if ( !item.has_upgrade( (*ib)->id() ) )
Upgrade* U = smart_cast<Upgrade*>(*ib);
if (!item.has_upgrade_group(U->parent_group_id()))
bool cant_install; // XXX Clear Sky upgrades: find a dynamic, universal solution
if (ClearSkyMode)
cant_install = !item.has_upgrade((*ib)->id());
else
{
Upgrade* U = smart_cast<Upgrade*>(*ib);
cant_install = !item.has_upgrade_group(U->parent_group_id());;
}

if (cant_install)
{
if (loading)
{
Expand Down
3 changes: 2 additions & 1 deletion src/xrGame/inventory_upgrade_root.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ void Root::highlight_hierarchy(shared_str const& upgrade_id)
{
if ((*ib)->id()._get() == upgrade_id._get())
{
// (*ib)->highlight_up();
if (ClearSkyMode) // XXX Clear Sky upgrades: find a dynamic, universal solution
(*ib)->highlight_up();
(*ib)->highlight_down();
return;
}
Expand Down

0 comments on commit 2f9bbe5

Please sign in to comment.