PDA

View Full Version : [BRP] Wrong formatting in /scripts/global.lua



peterb
June 14th, 2023, 14:50
On line 170 the function SetHitLocations is indented so that it looks like it is a part of the function Calc (on line 148), also the if statement in SetHitLocations is not properly closed. It looks like a copy/paste that has gone wrong. The indentation in Calc is wrong at line 162. There are two end statements following each other at line 243. The end statement on line 243 should be on line 169.

The error goes back to the version of the ruleset issued 2023-02-21. The code in /scripts/global.lua was rewritten in the next release.

I attach an edited version, this is how I think the file is meant to be formatted. I had to upload it as a text file, since lua files are not permitted.

ps. I missed another indentation error on line 280, the body and end statement of the if statement should be shifted right.

Moon Wizard
June 15th, 2023, 01:27
Formatting doesn't affect Lua scripting. It's just for reading. The BRP scripts are probably the oldest in the FG store at almost 20 years. Not all DLC developers have been consistent.

Regards,
JPG

Moon Wizard
June 15th, 2023, 01:33
I'll adjust the formatting for the next push anyway.

JPG

peterb
June 15th, 2023, 05:29
OK. Thanks!

Nylanfs
June 15th, 2023, 13:04
57739