From dde99ec6ab32b3fd34eaefef4fa55cbf541a97fd Mon Sep 17 00:00:00 2001
From: Yona-TYT <yonatan.el.amigo@gmail.com>
Date: Thu, 21 Nov 2024 12:07:20 -0400
Subject: [PATCH] Add new param in scenario_base.nut

---
 simutrans/script/scenario_base.nut       | 7 ++++---
 src/simutrans/script/api/api_skeleton.cc | 2 ++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/simutrans/script/scenario_base.nut b/simutrans/script/scenario_base.nut
index 6ae590726..2390a5ec2 100644
--- a/simutrans/script/scenario_base.nut
+++ b/simutrans/script/scenario_base.nut
@@ -41,9 +41,10 @@ foreach(tool_id in map.editing_tools) {
  * Called when filling toolbars, activating tools
  * Results are not transferred over network, use the rules.forbid_* functions in this case
  *
+ * @param name is raw tool name (String)
  * @return 1 if allowed, null otherwise
  */
-function is_tool_allowed(pl, tool_id, wt)
+function is_tool_allowed(pl, tool_id, wt, name)
 {
 	if (pl == 1) return true
 	return scenario.forbidden_tools.find( tool_id )==null; // null => not found => allowed
@@ -54,11 +55,11 @@ function is_tool_allowed(pl, tool_id, wt)
  * Error messages are sent back over network to clients.
  * Does not work with waybuilding etc use the rules.forbid_* functions in this case.
  *
+ * @param name is raw tool name (String) 
  * @param pos is a table with coordinate { x=, y=, z=}
- * @param tool is a table with current tool properties {coord3d start_pos, bool is_drag_tool, bool is_ctrl, bool is_shift}
  * @return null if allowed, an error message otherwise
  */
-function is_work_allowed_here(pl, tool_id, pos, tool)
+function is_work_allowed_here(pl, tool_id, name, pos, tool)
 {
 	return null
 }
diff --git a/src/simutrans/script/api/api_skeleton.cc b/src/simutrans/script/api/api_skeleton.cc
index 7607b14b4..4727bca01 100644
--- a/src/simutrans/script/api/api_skeleton.cc
+++ b/src/simutrans/script/api/api_skeleton.cc
@@ -213,6 +213,7 @@ register_function("is_scenario_completed");
  * @param pl player number
  * @param tool_id see @ref tool_ids
  * @param wt waytype of tool
+ * @param name is raw tool name (String)
  * @returns true if tool is allowed.
  * @typemask bool(integer,integer,way_types)
  * @ingroup scen_skel
@@ -237,6 +238,7 @@ register_function("is_tool_allowed");
  *
  * @param pl player number
  * @param tool_id see @ref tool_ids
+ * @param name is raw tool name (String)
  * @param pos coordinate
  *
  * @return null if allowed, an error message otherwise
-- 
2.47.0

