Skip to content

Commit

Permalink
fear(skymp5-server): ban disabled/deleted objects activation (skyrim-…
Browse files Browse the repository at this point in the history
  • Loading branch information
Pospelove authored Aug 27, 2024
1 parent 809206b commit 3ac1915
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions skymp5-server/cpp/server_guest_lib/MpObjectReference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1303,9 +1303,23 @@ void MpObjectReference::ProcessActivate(MpObjectReference& activationSource)

auto base = loader.GetBrowser().LookupById(GetBaseId());
if (!base.rec || !GetBaseId()) {
std::stringstream ss;
ss << std::hex << GetFormId() << " doesn't have base form";
throw std::runtime_error(ss.str());
return spdlog::error("MpObjectReference::ProcessActivate {:x} - doesn't "
"have base form, activationSource is {:x}",
GetFormId(), activationSource.GetFormId());
}

// Not sure if this is needed
if (IsDeleted()) {
return spdlog::warn("MpObjectReference::ProcessActivate {:x} - deleted "
"object, activationSource is {:x}",
GetFormId(), activationSource.GetFormId());
}

// Not sure if this is needed
if (IsDisabled()) {
return spdlog::warn("MpObjectReference::ProcessActivate {:x} - disabled "
"object, activationSource is {:x}",
GetFormId(), activationSource.GetFormId());
}

auto t = base.rec->GetType();
Expand Down

0 comments on commit 3ac1915

Please sign in to comment.