Skip to content

Commit

Permalink
fix(skymp5-server): reset timer id on resolve in RegisterForSingleUpd…
Browse files Browse the repository at this point in the history
…ate (#2336)
  • Loading branch information
nic11 authored Feb 12, 2025
1 parent 72614e6 commit 9886482
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ VarValue PapyrusForm::RegisterForSingleUpdate(
auto promise = worldState->SetTimer(time, &timerId);
uint32_t formId = form->GetFormId();
promise.Then([form, formId, worldState](const Viet::Void&) {
if (form == worldState->LookupFormById(formId).get()) {
form->Update();
if (form != worldState->LookupFormById(formId).get()) {
spdlog::error("form mismatch on timer resolve: formId={:x}", formId);
return;
}
form->SetSingleUpdateTimerId(std::nullopt);
form->Update();
});

form->SetSingleUpdateTimerId(timerId);
Expand Down

0 comments on commit 9886482

Please sign in to comment.