From 62d709a051f2fe44e08230e7341385ccb9d5a3c4 Mon Sep 17 00:00:00 2001 From: wixoa Date: Mon, 20 May 2024 01:08:31 -0400 Subject: [PATCH 1/4] Ignore attempts to set `mob.client = null` (#1799) --- OpenDreamRuntime/Objects/Types/DreamObjectMob.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/OpenDreamRuntime/Objects/Types/DreamObjectMob.cs b/OpenDreamRuntime/Objects/Types/DreamObjectMob.cs index 95fa2775e5..a1882c19f9 100644 --- a/OpenDreamRuntime/Objects/Types/DreamObjectMob.cs +++ b/OpenDreamRuntime/Objects/Types/DreamObjectMob.cs @@ -62,10 +62,9 @@ protected override void SetVar(string varName, DreamValue value) { case "client": value.TryGetValueAsDreamObject(out var newClient); + // An invalid client or a null does nothing here if (newClient != null) { newClient.Connection.Mob = this; - } else if (Connection != null) { - Connection.Mob = null; } break; From d77f19f41ad6d78d36a5809a23441ed8e92f83bf Mon Sep 17 00:00:00 2001 From: wixoa Date: Mon, 20 May 2024 01:08:56 -0400 Subject: [PATCH 2/4] Return true for any atom type in `isloc()` (#1800) --- .../Procs/Native/DreamProcNativeRoot.cs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/OpenDreamRuntime/Procs/Native/DreamProcNativeRoot.cs b/OpenDreamRuntime/Procs/Native/DreamProcNativeRoot.cs index 93065fb54c..ce70b16331 100644 --- a/OpenDreamRuntime/Procs/Native/DreamProcNativeRoot.cs +++ b/OpenDreamRuntime/Procs/Native/DreamProcNativeRoot.cs @@ -1077,15 +1077,10 @@ public static DreamValue NativeProc_islist(NativeProc.Bundle bundle, DreamObject [DreamProcParameter("Loc1", Type = DreamValueTypeFlag.DreamObject)] public static DreamValue NativeProc_isloc(NativeProc.Bundle bundle, DreamObject? src, DreamObject? usr) { foreach (var arg in bundle.Arguments) { - if (!arg.TryGetValueAsDreamObject(out var loc)) - return DreamValue.False; - if (loc is null) - return DreamValue.False; - - bool isLoc = loc is DreamObjectMob or DreamObjectTurf or DreamObjectArea || - loc.IsSubtypeOf(bundle.ObjectTree.Obj); - - if (!isLoc) + // The DM reference says "mobs, objs, turfs, or areas" + // You might think this excludes /atom/movable, but it does not + // So test for any DreamObjectAtom type + if (!arg.TryGetValueAsDreamObject(out _)) return DreamValue.False; } From a6373fb899d0412923a1081265c122bf52d177b7 Mon Sep 17 00:00:00 2001 From: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> Date: Wed, 22 May 2024 15:32:21 -0700 Subject: [PATCH 3/4] Animate Defines Cleanup (#1804) --- DMCompiler/DMStandard/Defines.dm | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/DMCompiler/DMStandard/Defines.dm b/DMCompiler/DMStandard/Defines.dm index 392848ee14..77ee139dd7 100644 --- a/DMCompiler/DMStandard/Defines.dm +++ b/DMCompiler/DMStandard/Defines.dm @@ -31,12 +31,27 @@ #define NEUTER "neuter" #define PLURAL "plural" +//animate() flags arg #define ANIMATION_END_NOW 1 #define ANIMATION_LINEAR_TRANSFORM 2 #define ANIMATION_PARALLEL 4 +#define ANIMATION_SLICE 8 +#define ANIMATION_RELATIVE 256 +#define ANIMATION_CONTINUE 512 + +//animate() easing arg +#define LINEAR_EASING 0 +#define SINE_EASING 1 +#define CIRCULAR_EASING 2 +#define CUBIC_EASING 3 +#define BOUNCE_EASING 4 +#define ELASTIC_EASING 5 +#define BACK_EASING 6 +#define QUAD_EASING 7 +#define JUMP_EASING 8 +//flags applied to the animate() easing arg #define EASE_IN 64 #define EASE_OUT 128 -#define ANIMATION_RELATIVE 256 #define NO_STEPS 0 #define FORWARD_STEPS 1 @@ -123,17 +138,6 @@ #define PASS_MOUSE (1<<10) #define TILE_MOVER (1<<11) -//animate() easing arg -#define LINEAR_EASING 0 -#define SINE_EASING 1 -#define CIRCULAR_EASING 2 -#define CUBIC_EASING 3 -#define BOUNCE_EASING 4 -#define ELASTIC_EASING 5 -#define BACK_EASING 6 -#define QUAD_EASING 7 -#define JUMP_EASING 8 - //Undocumented matrix defines (see https://www.byond.com/forum/post/1881375) #define MATRIX_COPY 0 #define MATRIX_MULTIPLY 1 // idk why this is first, either From d81e7a7ee8a6e43b41fce18a4d93eda23c8e98bc Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Thu, 23 May 2024 01:16:51 +0100 Subject: [PATCH 4/4] lint using resharper (#1797) --- .github/workflows/lint.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000000..cdc9c261c4 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,26 @@ +name: Lint + +on: + pull_request: + branches: [master] + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Setup submodule + run: | + git submodule update --init --recursive + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.0.100 + - name: Setup Resharper + run: dotnet tool install -g JetBrains.ReSharper.GlobalTools + - name: Run Linter + run: jb inspectcode OpenDream.sln -o="output.json" --project="OpenDream*;DM*" --no-swea + - uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: output.json