1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-22 19:54:06 +01:00

Codechange: remove manual param count; in all cases strlen(params) == nparams

This commit is contained in:
Rubidium
2025-04-26 21:10:08 +02:00
committed by rubidium42
parent 781187b8a6
commit c7056866a3
9 changed files with 47 additions and 49 deletions

View File

@@ -14,17 +14,17 @@ void SQAIController_Register(Squirrel *engine)
DefSQClass<ScriptController, ScriptType::AI> SQAIController("AIController");
SQAIController.PreRegister(engine);
SQAIController.DefSQStaticMethod(engine, &ScriptController::GetTick, "GetTick", 1, ".");
SQAIController.DefSQStaticMethod(engine, &ScriptController::GetOpsTillSuspend, "GetOpsTillSuspend", 1, ".");
SQAIController.DefSQStaticMethod(engine, &ScriptController::SetCommandDelay, "SetCommandDelay", 2, ".i");
SQAIController.DefSQStaticMethod(engine, &ScriptController::Sleep, "Sleep", 2, ".i");
SQAIController.DefSQStaticMethod(engine, &ScriptController::Break, "Break", 2, ".s");
SQAIController.DefSQStaticMethod(engine, &ScriptController::GetSetting, "GetSetting", 2, ".s");
SQAIController.DefSQStaticMethod(engine, &ScriptController::GetVersion, "GetVersion", 1, ".");
SQAIController.DefSQStaticMethod(engine, &ScriptController::Print, "Print", 3, ".bs");
SQAIController.DefSQStaticMethod(engine, &ScriptController::GetTick, "GetTick", ".");
SQAIController.DefSQStaticMethod(engine, &ScriptController::GetOpsTillSuspend, "GetOpsTillSuspend", ".");
SQAIController.DefSQStaticMethod(engine, &ScriptController::SetCommandDelay, "SetCommandDelay", ".i");
SQAIController.DefSQStaticMethod(engine, &ScriptController::Sleep, "Sleep", ".i");
SQAIController.DefSQStaticMethod(engine, &ScriptController::Break, "Break", ".s");
SQAIController.DefSQStaticMethod(engine, &ScriptController::GetSetting, "GetSetting", ".s");
SQAIController.DefSQStaticMethod(engine, &ScriptController::GetVersion, "GetVersion", ".");
SQAIController.DefSQStaticMethod(engine, &ScriptController::Print, "Print", ".bs");
SQAIController.PostRegister(engine);
/* Register the import statement to the global scope */
SQAIController.DefSQStaticMethod(engine, &ScriptController::Import, "import", 4, ".ssi");
SQAIController.DefSQStaticMethod(engine, &ScriptController::Import, "import", ".ssi");
}

View File

@@ -14,17 +14,17 @@ void SQGSController_Register(Squirrel *engine)
DefSQClass<ScriptController, ScriptType::GS> SQGSController("GSController");
SQGSController.PreRegister(engine);
SQGSController.DefSQStaticMethod(engine, &ScriptController::GetTick, "GetTick", 1, ".");
SQGSController.DefSQStaticMethod(engine, &ScriptController::GetOpsTillSuspend, "GetOpsTillSuspend", 1, ".");
SQGSController.DefSQStaticMethod(engine, &ScriptController::SetCommandDelay, "SetCommandDelay", 2, ".i");
SQGSController.DefSQStaticMethod(engine, &ScriptController::Sleep, "Sleep", 2, ".i");
SQGSController.DefSQStaticMethod(engine, &ScriptController::Break, "Break", 2, ".s");
SQGSController.DefSQStaticMethod(engine, &ScriptController::GetSetting, "GetSetting", 2, ".s");
SQGSController.DefSQStaticMethod(engine, &ScriptController::GetVersion, "GetVersion", 1, ".");
SQGSController.DefSQStaticMethod(engine, &ScriptController::Print, "Print", 3, ".bs");
SQGSController.DefSQStaticMethod(engine, &ScriptController::GetTick, "GetTick", ".");
SQGSController.DefSQStaticMethod(engine, &ScriptController::GetOpsTillSuspend, "GetOpsTillSuspend", ".");
SQGSController.DefSQStaticMethod(engine, &ScriptController::SetCommandDelay, "SetCommandDelay", ".i");
SQGSController.DefSQStaticMethod(engine, &ScriptController::Sleep, "Sleep", ".i");
SQGSController.DefSQStaticMethod(engine, &ScriptController::Break, "Break", ".s");
SQGSController.DefSQStaticMethod(engine, &ScriptController::GetSetting, "GetSetting", ".s");
SQGSController.DefSQStaticMethod(engine, &ScriptController::GetVersion, "GetVersion", ".");
SQGSController.DefSQStaticMethod(engine, &ScriptController::Print, "Print", ".bs");
SQGSController.PostRegister(engine);
/* Register the import statement to the global scope */
SQGSController.DefSQStaticMethod(engine, &ScriptController::Import, "import", 4, ".ssi");
SQGSController.DefSQStaticMethod(engine, &ScriptController::Import, "import", ".ssi");
}