Skip to content

Commit

Permalink
Helps if you include all relevant files in the commit.
Browse files Browse the repository at this point in the history
Also allow "disabled" as a string to temporary_enchant option, and fix
an issue with profile generation.
  • Loading branch information
navv1234 committed Dec 5, 2020
1 parent dea643c commit 44bea55
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
30 changes: 30 additions & 0 deletions engine/dbc/temporary_enchant.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// ==========================================================================
// Dedmonwakeen's Raid DPS/TPS Simulator.
// Send questions to [email protected]
// ==========================================================================
#ifndef TEMPORARY_ENCHANT_HPP
#define TEMPORARY_ENCHANT_HPP

#include "util/span.hpp"
#include "util/util.hpp"

#include "client_data.hpp"

struct temporary_enchant_entry_t
{
unsigned enchant_id;
unsigned spell_id;
const char* tokenized_name;

static const temporary_enchant_entry_t& find( util::string_view name, bool ptr );
static const temporary_enchant_entry_t& find_by_enchant_id( unsigned id, bool ptr );

static const temporary_enchant_entry_t& nil()
{ return dbc::nil<temporary_enchant_entry_t>; }

static util::span<const temporary_enchant_entry_t> data( bool ptr );
};

#endif /* GEM_DATA_HPP */


7 changes: 6 additions & 1 deletion engine/player/sc_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1701,6 +1701,11 @@ void player_t::init_initial_stats()

void player_t::parse_temporary_enchants()
{
if ( util::str_compare_ci( temporary_enchant_str, "disabled" ) )
{
return;
}

auto split = util::string_split( temporary_enchant_str, "/" );
for ( const auto& token : split )
{
Expand Down Expand Up @@ -10786,7 +10791,7 @@ std::string player_t::create_profile( save_e stype )
profile_str += "food=" + food_option + term;
if ( !rune_option.empty() )
profile_str += "augmentation=" + rune_option + term;
if ( !temporary_enchant_str.empty() )
if ( !tench_option.empty() )
profile_str += "temporary_enchant=" + temporary_enchant_str + term;
}

Expand Down

0 comments on commit 44bea55

Please sign in to comment.