[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
+2 -4
View File
@@ -509,12 +509,10 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object)
m_inst->SetRecastTimestamp(
database.GetItemRecastTimestamp(sender->CharacterID(), item->RecastType));
char buf[10];
snprintf(buf, 9, "%u", item->ID);
buf[9] = '\0';
std::string export_string = fmt::format("{}", item->ID);
std::vector<EQ::Any> args;
args.push_back(m_inst);
if(parse->EventPlayer(EVENT_PLAYER_PICKUP, sender, buf, this->GetID(), &args))
if(parse->EventPlayer(EVENT_PLAYER_PICKUP, sender, export_string, this->GetID(), &args))
{
auto outapp = new EQApplicationPacket(OP_ClickObject, sizeof(ClickObject_Struct));
memcpy(outapp->pBuffer, click_object, sizeof(ClickObject_Struct));