Skip to content

Commit

Permalink
fix: revert papyrus error handling refactoring for now (#2314)
Browse files Browse the repository at this point in the history
Revert "fix: repair error handling in Papyrus (#2297)"

This reverts commit 0291f6a.
  • Loading branch information
nic11 authored Feb 6, 2025
1 parent 171c51d commit f88a768
Show file tree
Hide file tree
Showing 7 changed files with 293 additions and 248 deletions.
4 changes: 2 additions & 2 deletions papyrus-vm/include/papyrus-vm/ActivePexInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ class ActivePexInstance

VarValue ExecuteAll(
ExecutionContext& ctx,
std::optional<VarValue> previousCallResult = std::nullopt) noexcept;
std::optional<VarValue> previousCallResult = std::nullopt);

void ExecuteOpCode(ExecutionContext* ctx, uint8_t op,
const std::vector<VarValue*>& arguments) noexcept;
const std::vector<VarValue*>& arguments);

bool EnsureCallResultIsSynchronous(const VarValue& callResult,
ExecutionContext* ctx);
Expand Down
6 changes: 6 additions & 0 deletions papyrus-vm/include/papyrus-vm/VirtualMachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class VirtualMachine

public:
using OnEnter = std::function<void(const StackData&)>;
using ExceptionHandler = std::function<void(VmExceptionInfo)>;
using MissingScriptHandler =
std::function<std::optional<PexScript::Lazy>(std::string)>;

Expand All @@ -73,6 +74,8 @@ class VirtualMachine

void SetMissingScriptHandler(const MissingScriptHandler& handler);

void SetExceptionHandler(const ExceptionHandler& handler);

void AddObject(std::shared_ptr<IGameObject> self,
const std::vector<ScriptInfo>& scripts);

Expand Down Expand Up @@ -109,6 +112,8 @@ class VirtualMachine

bool IsNativeFunctionByNameExisted(const std::string& name) const;

ExceptionHandler GetExceptionHandler() const;

std::set<CIString> ListClasses() const;
CIString GetBaseClass(const CIString& className) const;
std::set<CIString> ListStaticFunctions(const CIString& className) const;
Expand All @@ -129,6 +134,7 @@ class VirtualMachine
std::set<std::shared_ptr<IGameObject>> gameObjectsHolder;

MissingScriptHandler missingScriptHandler;
ExceptionHandler handler;

std::shared_ptr<MakeID> stackIdMaker;
};
Loading

0 comments on commit f88a768

Please sign in to comment.