1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-20 04:59:11 +00:00

Add: [Script] Event for when a company's president name changes

This commit is contained in:
Rubidium
2024-12-30 23:47:20 +01:00
committed by rubidium42
parent 9ab936f76b
commit 29129e12fd
7 changed files with 67 additions and 3 deletions

View File

@@ -2042,6 +2042,13 @@ function Regression::Start()
print(" CompanyName: " + c.GetNewName());
} break;
case AIEvent.ET_PRESIDENT_RENAMED: {
local c = AIEventPresidentRenamed.Convert(e);
print(" EventName: PresidentRenamed");
print(" CompanyID: " + c.GetCompanyID());
print(" PresidentName: " + c.GetNewName());
} break;
default:
print(" Unknown Event");
break;

View File

@@ -9716,6 +9716,11 @@ ERROR: IsEnd() is invalid as Begin() is never called
EventName: CompanyRenamed
CompanyID: 1
CompanyName: Regression
GetNextEvent: instance
GetEventType: 34
EventName: PresidentRenamed
CompanyID: 1
PresidentName: Regression AI
GetNextEvent: instance
GetEventType: 33
EventName: CompanyRenamed
@@ -9758,9 +9763,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 [2058]
*FUNCTION [unknown()] regression/main.nut line [2065]
*FUNCTION [Valuate()] NATIVE line [-1]
*FUNCTION [Start()] regression/main.nut line [2059]
*FUNCTION [Start()] regression/main.nut line [2066]
[id] 0
[this] TABLE
@@ -9769,7 +9774,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 [2059]
*FUNCTION [Start()] regression/main.nut line [2066]
[Infinite] CLOSURE
[list] INSTANCE