Revert "[Quest API] Cleanup string copies and push_backs. (#2807)"

This reverts commit bcc2e022dc.
This commit is contained in:
Akkadius
2023-01-31 20:30:34 -06:00
parent f727c9f75a
commit 54050924d8
21 changed files with 397 additions and 372 deletions
+15 -15
View File
@@ -468,7 +468,7 @@ int Client::HandlePacket(const EQApplicationPacket *app)
if (ConnectingOpcodes.count(opcode) != 1) {
//Hate const cast but everything in lua needs to be non-const even if i make it non-mutable
std::vector<std::any> args;
args.emplace_back(const_cast<EQApplicationPacket*>(app));
args.push_back(const_cast<EQApplicationPacket*>(app));
parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 1, &args);
break;
@@ -492,7 +492,7 @@ int Client::HandlePacket(const EQApplicationPacket *app)
p = ConnectedOpcodes[opcode];
if (p == nullptr) {
std::vector<std::any> args;
args.emplace_back(const_cast<EQApplicationPacket*>(app));
args.push_back(const_cast<EQApplicationPacket*>(app));
parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 0, &args);
break;
@@ -3092,11 +3092,11 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
CalcBonuses();
std::vector<std::any> args;
args.emplace_back(old_aug);
args.push_back(old_aug);
parse->EventItem(EVENT_UNAUGMENT_ITEM, this, tobe_auged, nullptr, "", in_augment->augment_index, &args);
args.assign(1, tobe_auged);
args.emplace_back(false);
args.push_back(false);
parse->EventItem(EVENT_AUGMENT_REMOVE, this, old_aug, nullptr, "", in_augment->augment_index, &args);
const auto export_string = fmt::format(
@@ -3108,7 +3108,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
false
);
args.emplace_back(old_aug);
args.push_back(old_aug);
parse->EventPlayer(EVENT_AUGMENT_REMOVE_CLIENT, this, export_string, 0, &args);
}
@@ -3119,13 +3119,13 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
aug = tobe_auged->GetAugment(in_augment->augment_index);
if (aug) {
std::vector<std::any> args;
args.emplace_back(aug);
args.push_back(aug);
parse->EventItem(EVENT_AUGMENT_ITEM, this, tobe_auged, nullptr, "", in_augment->augment_index, &args);
args.assign(1, tobe_auged);
parse->EventItem(EVENT_AUGMENT_INSERT, this, aug, nullptr, "", in_augment->augment_index, &args);
args.emplace_back(aug);
args.push_back(aug);
const auto export_string = fmt::format(
"{} {} {} {}",
@@ -3187,14 +3187,14 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
aug = tobe_auged->GetAugment(in_augment->augment_index);
if (aug) {
std::vector<std::any> args;
args.emplace_back(aug);
args.push_back(aug);
parse->EventItem(EVENT_UNAUGMENT_ITEM, this, tobe_auged, nullptr, "", in_augment->augment_index, &args);
args.assign(1, tobe_auged);
args.emplace_back(false);
args.push_back(false);
parse->EventItem(EVENT_AUGMENT_REMOVE, this, aug, nullptr, "", in_augment->augment_index, &args);
args.emplace_back(aug);
args.push_back(aug);
const auto export_string = fmt::format(
"{} {} {} {} {}",
@@ -3251,14 +3251,14 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
aug = tobe_auged->GetAugment(in_augment->augment_index);
if (aug) {
std::vector<std::any> args;
args.emplace_back(aug);
args.push_back(aug);
parse->EventItem(EVENT_UNAUGMENT_ITEM, this, tobe_auged, nullptr, "", in_augment->augment_index, &args);
args.assign(1, tobe_auged);
args.emplace_back(true);
args.push_back(true);
parse->EventItem(EVENT_AUGMENT_REMOVE, this, aug, nullptr, "", in_augment->augment_index, &args);
args.emplace_back(aug);
args.push_back(aug);
const auto export_string = fmt::format(
"{} {} {} {} {}",
@@ -4395,7 +4395,7 @@ void Client::Handle_OP_ClickDoor(const EQApplicationPacket *app)
std::string export_string = fmt::format("{}", cd->doorid);
std::vector<std::any> args;
args.emplace_back(currentdoor);
args.push_back(currentdoor);
if (parse->EventPlayer(EVENT_CLICK_DOOR, this, export_string, 0, &args) == 0)
{
currentdoor->HandleClick(this, 0);
@@ -4418,7 +4418,7 @@ void Client::Handle_OP_ClickObject(const EQApplicationPacket *app)
object->HandleClick(this, click_object);
std::vector<std::any> args;
args.emplace_back(object);
args.push_back(object);
std::string export_string = fmt::format("{}", click_object->drop_id);
parse->EventPlayer(EVENT_CLICK_OBJECT, this, export_string, GetID(), &args);