[Quest API] Further char array cleanup. (#1634)

- Cleans up the rest of the char arrays used when exporting to events.
- Converts all events to use a similar variable name for export `export_string`.
- Needless calls to .c_str() removed.
This commit is contained in:
Kinglykrab
2021-10-24 17:06:22 -04:00
committed by GitHub
parent 624d11de4e
commit c98f3cfb4c
12 changed files with 107 additions and 99 deletions
+8 -7
View File
@@ -2415,9 +2415,12 @@ bool Client::CheckIncreaseSkill(EQ::skills::SkillType skillid, Mob *against_who,
return false;
int skillval = GetRawSkill(skillid);
int maxskill = GetMaxSkillAfterSpecializationRules(skillid, MaxSkill(skillid));
char buffer[24] = { 0 };
snprintf(buffer, 23, "%d %d", skillid, skillval);
parse->EventPlayer(EVENT_USE_SKILL, this, buffer, 0);
std::string export_string = fmt::format(
"{} {}",
skillid,
skillval
);
parse->EventPlayer(EVENT_USE_SKILL, this, export_string, 0);
if (against_who) {
if (
against_who->GetSpecialAbility(IMMUNE_AGGRO) ||
@@ -5343,10 +5346,8 @@ void Client::ShowSkillsWindow()
void Client::Signal(uint32 data)
{
char buf[32];
snprintf(buf, 31, "%d", data);
buf[31] = '\0';
parse->EventPlayer(EVENT_SIGNAL, this, buf, 0);
std::string export_string = fmt::format("{}", data);
parse->EventPlayer(EVENT_SIGNAL, this, export_string, 0);
}
void Client::SendRewards()