forked from rosebudai/OpenRCT2-Web
Add plugin name to CustomAction and ScriptEngine
This commit is contained in:
1 parent
90b65cd890
commit
c1f75a0906
5 files changed
+16
-8
No files matched your search
@@ -1090,7 +1090,7 @@ GameActions::Result ScriptEngine::QueryOrExecuteCustomGameAction(const CustomAct
|
||||
|
||||
auto action = GameActions::Result();
|
||||
action.Error = GameActions::Status::Unknown;
|
||||
action.ErrorTitle = "Unknown custom action";
|
||||
action.ErrorTitle = " [Unknown custom action] \n" + customAction.GetPluginName() + ": " + actionz;
|
||||
return action;
|
||||
}
|
||||
|
||||
@@ -1466,7 +1466,7 @@ void ScriptEngine::RunGameActionHooks(const GameAction& action, GameActions::Res
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<GameAction> ScriptEngine::CreateGameAction(const std::string& actionid, const DukValue& args)
|
||||
std::unique_ptr<GameAction> ScriptEngine::CreateGameAction(const std::string& actionid, const DukValue& args, const std::string& pluginName)
|
||||
{
|
||||
auto action = CreateGameActionFromActionId(actionid);
|
||||
if (action != nullptr)
|
||||
@@ -1494,7 +1494,7 @@ std::unique_ptr<GameAction> ScriptEngine::CreateGameAction(const std::string& ac
|
||||
auto jsonz = duk_json_encode(ctx, -1);
|
||||
auto json = std::string(jsonz);
|
||||
duk_pop(ctx);
|
||||
auto customAction = std::make_unique<CustomAction>(actionid, json);
|
||||
auto customAction = std::make_unique<CustomAction>(actionid, json, pluginName);
|
||||
|
||||
if (customAction->GetPlayer() == -1 && NetworkGetMode() != NETWORK_MODE_NONE)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user