Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix 'magnetic furniture' bug #2340

Merged
merged 15 commits into from
Feb 14, 2025
12 changes: 7 additions & 5 deletions skymp5-client/src/services/services/remoteServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,14 @@ export class RemoteServer extends ClientListener {
}
};

this.controller.emitter.emit("sendMessage", {
message: message,
reliability: "reliable"
});
Utility.waitMenuMode(1).then(() => {
this.controller.emitter.emit("sendMessage", {
message: message,
reliability: "reliable"
});

logTrace(this, "onOpenContainerMesage - sent ActivateMessage", message);
logTrace(this, "onOpenContainerMesage - sent ActivateMessage", message);
});
})();
});
}
Expand Down
27 changes: 19 additions & 8 deletions skymp5-server/cpp/server_guest_lib/MpObjectReference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1599,10 +1599,22 @@ bool MpObjectReference::CheckIfObjectCanStartOccupyThis(
}

if (this->occupant == &activationSource) {
spdlog::info("MpObjectReference::ProcessActivate {:x} - occupant is "
"already this object (activationSource = {:x})",
GetFormId(), activationSource.GetFormId());
return true;
auto& loader = GetParent()->GetEspm();
auto base = loader.GetBrowser().LookupById(GetBaseId());
auto t = base.rec->GetType();
auto actorActivator = activationSource.AsActor();
if (t == "FURN" && actorActivator) {
spdlog::info("MpObjectReference::ProcessActivate {:x} - occupant is "
"already this object (activationSource = {:x}). Blocking "
"because it's FURN",
GetFormId(), activationSource.GetFormId());
return false;
} else {
spdlog::info("MpObjectReference::ProcessActivate {:x} - occupant is "
"already this object (activationSource = {:x})",
GetFormId(), activationSource.GetFormId());
return true;
}
}

spdlog::info("MpObjectReference::ProcessActivate {:x} - occupant is "
Expand Down Expand Up @@ -1773,10 +1785,9 @@ void MpObjectReference::SendInventoryUpdate()
if (actor) {
std::string msg;
msg += Networking::MinPacketId;
msg += nlohmann::json{
{ "inventory", actor->GetInventory().ToJson() },
{ "type", "setInventory" }
}.dump();
msg += nlohmann::json{ { "inventory", actor->GetInventory().ToJson() },
{ "type", "setInventory" } }
.dump();
actor->SendToUserDeferred(msg.data(), msg.size(), true,
kChannelSetInventory, true);
}
Expand Down
Loading