Skip to content

Commit 2e8139b

Browse files
committed
fix(events): Return Value
1 parent a80cba0 commit 2e8139b

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ Over here will be noted all the update change logs.
1212

1313
- Fix VData pointer not being correctly set
1414

15+
### Events
16+
17+
- Fix TriggerEvent return value
18+
1519
## v1.6.28 - [Release](https://github.com/swiftly-solution/swiftly/releases/tag/v1.6.28)
1620

1721
### GameData / Signatures

src/plugins/object.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ EventResult PluginObject::TriggerEventJSON(std::string invokedBy, std::string ev
122122
if (value.isNumber())
123123
{
124124
int result = value.cast<int>();
125-
if (result < (int)EventResult::Continue || result >(int)EventResult::Stop)
125+
if (result < (int)EventResult::Continue || result >(int)EventResult::Handled)
126126
response = EventResult::Continue;
127127
else
128128
response = (EventResult)result;

src/scripting/engine/events.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ LoadScriptingComponent(events, [](PluginObject plugin, EContext* ctx) -> void {
6565
ClassData* evObject = new ClassData({ { "plugin_name", FetchPluginName(context->GetPluginContext()) }, { "should_mark_freeable", true } }, "Event", nullptr);
6666
std::vector<std::any> returnValues;
6767

68-
returnValues.push_back((int)g_pluginManager.ExecuteEventJSON(FetchPluginName(context->GetPluginContext()), event_name, event_data, evObject));
68+
returnValues.push_back((int)(g_pluginManager.ExecuteEventJSON(FetchPluginName(context->GetPluginContext()), event_name, event_data, evObject)));
6969
returnValues.push_back(evObject);
7070

7171
context->SetReturn(returnValues);

0 commit comments

Comments
 (0)