1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-21 21:49:10 +00:00

Add: [Script] ScriptEventCompanyRename (#12878)

This commit is contained in:
Björn Wärmedal
2025-01-14 10:24:28 +01:00
committed by GitHub
parent 3a7cfafe51
commit 9ab936f76b
7 changed files with 72 additions and 3 deletions

View File

@@ -2035,6 +2035,13 @@ function Regression::Start()
print(" VehicleID: " + c.GetVehicleID());
} break;
case AIEvent.ET_COMPANY_RENAMED: {
local c = AIEventCompanyRenamed.Convert(e);
print(" EventName: CompanyRenamed");
print(" CompanyID: " + c.GetCompanyID());
print(" CompanyName: " + c.GetNewName());
} break;
default:
print(" Unknown Event");
break;

View File

@@ -9711,6 +9711,16 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetDestinationType(): 1
GetDestinationIndex(): 7
GetCargoType(): 0
GetNextEvent: instance
GetEventType: 33
EventName: CompanyRenamed
CompanyID: 1
CompanyName: Regression
GetNextEvent: instance
GetEventType: 33
EventName: CompanyRenamed
CompanyID: 1
CompanyName: Little Frutford Transport
IsEventWaiting: false
--Math--
@@ -9748,9 +9758,9 @@ ERROR: IsEnd() is invalid as Begin() is never called
--Valuate() with excessive CPU usage--
Your script made an error: excessive CPU usage in valuator function
*FUNCTION [unknown()] regression/main.nut line [2051]
*FUNCTION [unknown()] regression/main.nut line [2058]
*FUNCTION [Valuate()] NATIVE line [-1]
*FUNCTION [Start()] regression/main.nut line [2052]
*FUNCTION [Start()] regression/main.nut line [2059]
[id] 0
[this] TABLE
@@ -9759,7 +9769,7 @@ Your script made an error: excessive CPU usage in valuator function
[this] INSTANCE
Your script made an error: excessive CPU usage in valuator function
*FUNCTION [Start()] regression/main.nut line [2052]
*FUNCTION [Start()] regression/main.nut line [2059]
[Infinite] CLOSURE
[list] INSTANCE