mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-16 03:23:15 +01:00
Add plugin name to CustomAction and ScriptEngine
This commit is contained in:
@@ -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