mirror of
https://github.com/EQEmu/Server.git
synced 2026-08-29 00:18:18 +00:00
[Doors] Remove door dev tools spam on client controlled doors (#2824)
* [Doors] Remove door dev tools spam on client controlled doors * Update client_packet.cpp * Update client_packet.cpp * Update ruletypes.h
This commit is contained in:
+27
-8
@@ -4385,27 +4385,46 @@ void Client::Handle_OP_ClickDoor(const EQApplicationPacket *app)
|
||||
return;
|
||||
}
|
||||
|
||||
// set door selected
|
||||
if (IsDevToolsEnabled()) {
|
||||
float distance = DistanceNoZ(GetPosition(), currentdoor->GetPosition());
|
||||
|
||||
LogDoors(
|
||||
"Door [{}] client handle, client distance from door [{:.2f}]",
|
||||
currentdoor->GetDoorID(),
|
||||
distance
|
||||
);
|
||||
|
||||
bool within_distance = distance < RuleI(Range, MaxDistanceToClickDoors);
|
||||
|
||||
// distance gate this because some doors are client controlled and the client
|
||||
// will spam door click even across the zone to force a door back into desired state
|
||||
if (IsDevToolsEnabled() && within_distance) {
|
||||
SetDoorToolEntityId(currentdoor->GetEntityID());
|
||||
DoorManipulation::CommandHeader(this);
|
||||
Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Door ({}) [{}]",
|
||||
currentdoor->GetEntityID(),
|
||||
currentdoor->GetDoorID(),
|
||||
Saylink::Silent("#door edit")
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
std::string export_string = fmt::format("{}", cd->doorid);
|
||||
std::vector<std::any> args;
|
||||
args.push_back(currentdoor);
|
||||
if (parse->EventPlayer(EVENT_CLICK_DOOR, this, export_string, 0, &args) == 0)
|
||||
{
|
||||
// don't spam scripts with client controlled doors if not within distance
|
||||
if (within_distance) {
|
||||
std::string export_string = fmt::format("{}", cd->doorid);
|
||||
std::vector<std::any> args;
|
||||
args.push_back(currentdoor);
|
||||
if (parse->EventPlayer(EVENT_CLICK_DOOR, this, export_string, 0, &args) == 0) {
|
||||
currentdoor->HandleClick(this, 0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// we let this pass because client controlled doors require this to force the linked doors
|
||||
// back into state
|
||||
currentdoor->HandleClick(this, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Client::Handle_OP_ClickObject(const EQApplicationPacket *app)
|
||||
|
||||
Reference in New Issue
Block a user