From bcc302bcc29464a4c1a0ed62fd6b4083cae745b0 Mon Sep 17 00:00:00 2001 From: AllyTally Date: Mon, 4 Sep 2023 00:34:20 -0300 Subject: [PATCH] Fix bug with `destroy(moving)`/`destroy(disappear)` This commit fixes an obscure bug with `destroy(moving)` and `destroy(disappear)` where, when looping through entities, the code doesn't actually check what the entity is before trying to destroy the block underneath it. To fix this, we just put the block-destroying code *inside* of the check, instead of being outside of it. I also fixed the code style because it was horrible. --- desktop_version/src/Script.cpp | 53 ++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 15 deletions(-) diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index 297cd486..f68aff45 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -268,25 +268,48 @@ void scriptclass::run(void) } if (words[0] == "destroy") { - if(words[1]=="gravitylines"){ - for(size_t edi=0; edi