Skip to content

Commit

Permalink
update structures
Browse files Browse the repository at this point in the history
  • Loading branch information
BenLubar committed Jul 2, 2020
1 parent 27ee6a3 commit 72ce52e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
11 changes: 1 addition & 10 deletions library/modules/Translation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,7 @@ bool Translation::copyName(df::language_name * source, df::language_name * targe
if (source == target)
return true;

target->first_name = source->first_name;
target->nickname = source->nickname;
for (int i = 0; i < 7; i++)
{
target->words[i] = source->words[i];
target->parts_of_speech[i] = source->parts_of_speech[i];
}
target->language = source->language;
target->unknown = source->unknown;
target->has_name = source->has_name;
*target = *source;
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion library/xml
8 changes: 4 additions & 4 deletions plugins/strangemood.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ void selectWord (const df::language_word_table &table, int32_t &word, df::part_o
}
}

void generateName(df::language_name &output, int language, int mode, const df::language_word_table &table1, const df::language_word_table &table2)
void generateName(df::language_name &output, int language, df::language_name_type mode, const df::language_word_table &table1, const df::language_word_table &table2)
{
for (int i = 0; i < 100; i++)
{
Expand All @@ -162,7 +162,7 @@ void generateName(df::language_name &output, int language, int mode, const df::l
output = df::language_name();
if (language == -1)
language = rng.df_trandom(world->raws.language.translations.size());
output.unknown = mode;
output.type = mode;
output.language = language;
}
output.has_name = 1;
Expand Down Expand Up @@ -1316,10 +1316,10 @@ command_result df_strangemood (color_ostream &out, vector <string> & parameters)

// Generate the artifact's name
if (type == mood_type::Fell || type == mood_type::Macabre)
generateName(unit->status.artifact_name, unit->name.language, 1, world->raws.language.word_table[0][2], world->raws.language.word_table[1][2]);
generateName(unit->status.artifact_name, unit->name.language, language_name_type::Artifact, world->raws.language.word_table[0][2], world->raws.language.word_table[1][2]);
else
{
generateName(unit->status.artifact_name, unit->name.language, 1, world->raws.language.word_table[0][1], world->raws.language.word_table[1][1]);
generateName(unit->status.artifact_name, unit->name.language, language_name_type::Artifact, world->raws.language.word_table[0][1], world->raws.language.word_table[1][1]);
if (!rng.df_trandom(100))
unit->status.artifact_name = unit->name;
}
Expand Down

0 comments on commit 72ce52e

Please sign in to comment.