Skip to content

Commit

Permalink
Merge pull request #3296 from jasonch35/soullink-reload-sc_type
Browse files Browse the repository at this point in the history
Reload status_type on `@reloadskilldb`
  • Loading branch information
skyleo authored May 24, 2024
2 parents 6630f07 + 2ba21ba commit e5aefbf
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
1 change: 1 addition & 0 deletions src/map/atcommand.c
Original file line number Diff line number Diff line change
Expand Up @@ -3903,6 +3903,7 @@ ACMD(reloadmobdb)
ACMD(reloadskilldb)
{
skill->reload();
status->load_sc_type();
homun->reload_skill();
elemental->reload_skilldb();
mercenary->read_skilldb();
Expand Down
39 changes: 23 additions & 16 deletions src/map/status.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,22 +134,8 @@ static void initChangeTables(void)
memset(status->dbs->ChangeFlagTable, 0, sizeof(status->dbs->ChangeFlagTable));
memset(status->dbs->DisplayType, 0, sizeof(status->dbs->DisplayType));

// Storing the target job rather than simply SC_SOULLINK simplifies code later on.
skill->dbs->db[skill->get_index(SL_ALCHEMIST)].status_type = (sc_type)MAPID_ALCHEMIST;
skill->dbs->db[skill->get_index(SL_MONK)].status_type = (sc_type)MAPID_MONK;
skill->dbs->db[skill->get_index(SL_STAR)].status_type = (sc_type)MAPID_STAR_GLADIATOR;
skill->dbs->db[skill->get_index(SL_SAGE)].status_type = (sc_type)MAPID_SAGE;
skill->dbs->db[skill->get_index(SL_CRUSADER)].status_type = (sc_type)MAPID_CRUSADER;
skill->dbs->db[skill->get_index(SL_SUPERNOVICE)].status_type = (sc_type)MAPID_SUPER_NOVICE;
skill->dbs->db[skill->get_index(SL_KNIGHT)].status_type = (sc_type)MAPID_KNIGHT;
skill->dbs->db[skill->get_index(SL_WIZARD)].status_type = (sc_type)MAPID_WIZARD;
skill->dbs->db[skill->get_index(SL_PRIEST)].status_type = (sc_type)MAPID_PRIEST;
skill->dbs->db[skill->get_index(SL_BARDDANCER)].status_type = (sc_type)MAPID_BARDDANCER;
skill->dbs->db[skill->get_index(SL_ROGUE)].status_type = (sc_type)MAPID_ROGUE;
skill->dbs->db[skill->get_index(SL_ASSASIN)].status_type = (sc_type)MAPID_ASSASSIN;
skill->dbs->db[skill->get_index(SL_BLACKSMITH)].status_type = (sc_type)MAPID_BLACKSMITH;
skill->dbs->db[skill->get_index(SL_HUNTER)].status_type = (sc_type)MAPID_HUNTER;
skill->dbs->db[skill->get_index(SL_SOULLINKER)].status_type = (sc_type)MAPID_SOUL_LINKER;
status->load_sc_type();

#undef set_sc_with_vfx
}

Expand Down Expand Up @@ -13994,6 +13980,26 @@ static void status_check_job_bonus(int idx, const char *name, int class)
}
}

static void status_load_sc_type(void)
{
// Storing the target job rather than simply SC_SOULLINK simplifies code later on.
skill->dbs->db[skill->get_index(SL_ALCHEMIST)].status_type = (sc_type)MAPID_ALCHEMIST;
skill->dbs->db[skill->get_index(SL_MONK)].status_type = (sc_type)MAPID_MONK;
skill->dbs->db[skill->get_index(SL_STAR)].status_type = (sc_type)MAPID_STAR_GLADIATOR;
skill->dbs->db[skill->get_index(SL_SAGE)].status_type = (sc_type)MAPID_SAGE;
skill->dbs->db[skill->get_index(SL_CRUSADER)].status_type = (sc_type)MAPID_CRUSADER;
skill->dbs->db[skill->get_index(SL_SUPERNOVICE)].status_type = (sc_type)MAPID_SUPER_NOVICE;
skill->dbs->db[skill->get_index(SL_KNIGHT)].status_type = (sc_type)MAPID_KNIGHT;
skill->dbs->db[skill->get_index(SL_WIZARD)].status_type = (sc_type)MAPID_WIZARD;
skill->dbs->db[skill->get_index(SL_PRIEST)].status_type = (sc_type)MAPID_PRIEST;
skill->dbs->db[skill->get_index(SL_BARDDANCER)].status_type = (sc_type)MAPID_BARDDANCER;
skill->dbs->db[skill->get_index(SL_ROGUE)].status_type = (sc_type)MAPID_ROGUE;
skill->dbs->db[skill->get_index(SL_ASSASIN)].status_type = (sc_type)MAPID_ASSASSIN;
skill->dbs->db[skill->get_index(SL_BLACKSMITH)].status_type = (sc_type)MAPID_BLACKSMITH;
skill->dbs->db[skill->get_index(SL_HUNTER)].status_type = (sc_type)MAPID_HUNTER;
skill->dbs->db[skill->get_index(SL_SOULLINKER)].status_type = (sc_type)MAPID_SOUL_LINKER;
}

static bool status_readdb_job2(char *fields[], int columns, int current)
{
int idx, class, i;
Expand Down Expand Up @@ -14759,6 +14765,7 @@ void status_defaults(void)
status->change_start_unknown_sc = status_change_start_unknown_sc;
status->display_remove = status_display_remove;
status->natural_heal = status_natural_heal;
status->load_sc_type = status_load_sc_type;
status->natural_heal_timer = status_natural_heal_timer;
status->readdb_job2 = status_readdb_job2;
status->readdb_sizefix = status_readdb_sizefix;
Expand Down
1 change: 1 addition & 0 deletions src/map/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -1512,6 +1512,7 @@ struct status_interface {
void (*display_remove) (struct map_session_data *sd, enum sc_type type);
int (*natural_heal) (struct block_list *bl, va_list args);
int (*natural_heal_timer) (int tid, int64 tick, int id, intptr_t data);
void (*load_sc_type) (void);
bool (*readdb_job2) (char *fields[], int columns, int current);
bool (*readdb_sizefix) (char *fields[], int columns, int current);
bool (*read_scdb_libconfig) (void);
Expand Down

0 comments on commit e5aefbf

Please sign in to comment.