Commit graph

14 commits

Author SHA1 Message Date
phosit
582541ea80 Enable eslint rule 'no-useless-assignment'
Enable rule 'no-useless-assignment' [1] and fix violations.

[1] https://eslint.org/docs/latest/rules/no-useless-assignment
2025-08-01 11:26:40 +02:00
Ralph Sennhauser
97a82cbc4a
Enable eslint rule 'no-redeclare'
Enable recommended rule 'no-redeclare' [1] and manually fix violations.

[1] https://eslint.org/docs/latest/rules/no-redeclare

Ref: #8068
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-14 14:53:10 +02:00
Ralph Sennhauser
bc5f42d4a4
Fix eslint rule 'no-else-return'
Use ternary expressions instead.

eslint--no-config-lookup --fix --rule '"no-else-return": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-04 22:34:54 +02:00
Ralph Sennhauser
dc6544a6c4
Fix eslint rule 'operator-assignment'
eslint --no-config-lookup --fix --rule '"operator-assignment": 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-03 19:02:10 +02:00
Ralph Sennhauser
fd0f7cc270
Fix eslint rule 'comma-spacing'
eslint --no-config-lookup --fix --rule '""comma-spacing: 1'

Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-03 15:12:53 +02:00
elexis
7f4950cb17 Use https in hyperlinks for sites that support it, refs #5257.
This was SVN commit r21870.
2018-08-23 09:23:06 +00:00
elexis
6590f301c2 Add Math.square to compute the square of a number without the need to repeat the term, without using the slower Math.pow.
Start unifying the euclidian distance functions instead of adding yet
another helper function to the random map script library after this
diff.

Differential Revision: https://code.wildfiregames.com/D969
Math.square accepted by mimo
Includes changes proposed by bb, fatherbushido

This was SVN commit r20328.
2017-10-22 20:46:41 +00:00
elexis
6149dd3841 Actually remove trailing whitespace for non-header files as well.
This was SVN commit r18989.
2016-11-23 13:02:58 +00:00
sanderd17
ecaded076f Improve the Vector prototype with static functions. Replace the usage of the Math vector functions with functions from the Vector class.
This was SVN commit r14659.
2014-01-24 19:51:00 +00:00
JoshuaJB
c02dafec74 Move simulation Vector math to globalscripts/Math.js. Refs #2032.
This was SVN commit r14606.
2014-01-18 15:27:30 +00:00
historic_bruno
0933925d49 Adds JS implementations of Math.pow, exp, and log, by sanderd17, refs #1193.
Fixes #1990 (OOS caused by Math.pow).
Adds tests and documentation for Math functions.

This was SVN commit r13515.
2013-06-30 05:16:20 +00:00
quantumstate
7c51e743fa Modified rmgen GetAngle function to use atan2 and the standard mathematical angle convention (WARNING this changes return values so will break scripts using the old version) and changed getGradient so it returns Infinity for infinite gradient lines. Added errors if people try and use unsafe javascript maths functions.
This was SVN commit r11363.
2012-03-18 18:40:27 +00:00
quantumstate
291a9e797b Added atan and atan2. Refs #1193
This was SVN commit r11231.
2012-03-03 23:37:47 +00:00
quantumstate
cc955af3b1 Added javascript file for previous commit.
This was SVN commit r11227.
2012-03-03 00:07:11 +00:00