mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 18:51:29 +00:00
[Quest API] (Performance) Check event exists before export and execute EVENT_UNHANDLED_OPCODE (#2918)
# Notes - Optionally parse this event instead of always doing so.
This commit is contained in:
parent
1bf24273d2
commit
2dffc66c6f
@ -468,10 +468,10 @@ int Client::HandlePacket(const EQApplicationPacket *app)
|
||||
switch (client_state) {
|
||||
case CLIENT_CONNECTING: {
|
||||
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.push_back(const_cast<EQApplicationPacket*>(app));
|
||||
if (parse->PlayerHasQuestSub(EVENT_UNHANDLED_OPCODE)) {
|
||||
std::vector<std::any> args = {const_cast<EQApplicationPacket *>(app)};
|
||||
parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 1, &args);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
@ -493,9 +493,10 @@ int Client::HandlePacket(const EQApplicationPacket *app)
|
||||
ClientPacketProc p;
|
||||
p = ConnectedOpcodes[opcode];
|
||||
if (p == nullptr) {
|
||||
std::vector<std::any> args;
|
||||
args.push_back(const_cast<EQApplicationPacket*>(app));
|
||||
if (parse->PlayerHasQuestSub(EVENT_UNHANDLED_OPCODE)) {
|
||||
std::vector<std::any> args = {const_cast<EQApplicationPacket *>(app)};
|
||||
parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 0, &args);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user