Skip to content

Commit

Permalink
Limit extra Ru ability info to followers (amalloy)
Browse files Browse the repository at this point in the history
The Ru sacrifice ability description contains code for showing sacrifice
significance and piety gain, which crashed if the player was not
following Ru for some abilities. This commit simply hides that line
of text, as well as mutation-specific text for sacrifices that add
mutations, and re-enables using the ability description view for
?/A, which is currently the only way for non-followers to view the
description.
  • Loading branch information
aidanholm committed Nov 8, 2018
1 parent 57a8110 commit 0aa8dd0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions crawl-ref/source/ability.cc
Expand Up @@ -1089,6 +1089,9 @@ static string _sacrifice_desc(const ability_type ability)
const string piety_info = ru_sacrifice_description(ability);
const string desc = boilerplate + piety_info;

if (!you_worship(GOD_RU))
return desc;

const string sac_vec_key = ru_sacrifice_vector(ability);
if (sac_vec_key.empty())
return desc;
Expand Down
3 changes: 3 additions & 0 deletions crawl-ref/source/god-abil.cc
Expand Up @@ -5818,6 +5818,9 @@ static int _ru_get_sac_piety_gain(ability_type sac)

string ru_sacrifice_description(ability_type sac)
{
if (!you_worship(GOD_RU))
return "";

const int piety_gain = _ru_get_sac_piety_gain(sac);
return make_stringf("This is %s sacrifice. Piety after sacrifice: %s",
_describe_sacrifice_piety_gain(piety_gain),
Expand Down
2 changes: 1 addition & 1 deletion crawl-ref/source/lookup-help.cc
Expand Up @@ -1263,7 +1263,7 @@ static const vector<LookupType> lookup_types = {
_describe_skill, lookup_type::none),
LookupType('A', "ability", _recap_ability_keys, _ability_filter,
nullptr, nullptr, _ability_menu_gen,
_describe_generic, lookup_type::db_suffix),
_describe_ability, lookup_type::db_suffix),
LookupType('C', "card", _recap_card_keys, _card_filter,
nullptr, nullptr, _card_menu_gen,
_describe_card, lookup_type::db_suffix),
Expand Down

0 comments on commit 0aa8dd0

Please sign in to comment.