From c8b1b6251bf7b87e65da75c6f238248236bc95e5 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Wed, 28 Jul 2021 18:42:32 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20for=20Pok=C3=A9mon=20editor=20deleting=20?= =?UTF-8?q?a=20moveset=20move=20when=20"changing"=20which=20move=20it=20is?= =?UTF-8?q?=20to=20the=20same=20move,=20fixed=20typo=20in=20def=20addBackg?= =?UTF-8?q?roundOrColoredPlane.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Data/Scripts/007_Objects and windows/002_MessageConfig.rb | 2 +- Data/Scripts/020_Debug/002_Editor_DataTypes.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Data/Scripts/007_Objects and windows/002_MessageConfig.rb b/Data/Scripts/007_Objects and windows/002_MessageConfig.rb index 280e3a2c9..737a2dca2 100644 --- a/Data/Scripts/007_Objects and windows/002_MessageConfig.rb +++ b/Data/Scripts/007_Objects and windows/002_MessageConfig.rb @@ -742,7 +742,7 @@ def addBackgroundOrColoredPlane(sprites,planename,background,color,viewport=nil) bitmapName=pbResolveBitmap("Graphics/Pictures/#{background}") if bitmapName==nil # Plane should exist in any case - sprites[planename]=ColoredPlane.new(color,@viewport) + sprites[planename]=ColoredPlane.new(color,viewport) else sprites[planename]=AnimatedPlane.new(viewport) sprites[planename].setBitmap(bitmapName) diff --git a/Data/Scripts/020_Debug/002_Editor_DataTypes.rb b/Data/Scripts/020_Debug/002_Editor_DataTypes.rb index 5516f7137..8afd32dee 100644 --- a/Data/Scripts/020_Debug/002_Editor_DataTypes.rb +++ b/Data/Scripts/020_Debug/002_Editor_DataTypes.rb @@ -1004,7 +1004,7 @@ module MovePoolProperty end when 1 # Change move newmove = pbChooseMoveList(entry[1]) - if newmove + if newmove && newmove != entry[1] havemove = -1 realcmds.each do |e| havemove = e[2] if e[0] == entry[0] && e[1] == newmove @@ -1012,6 +1012,7 @@ module MovePoolProperty if havemove >= 0 # New move already known at level; delete this move realcmds[cmd[1]] = nil realcmds.compact! + cmd[1] = [cmd[1], realcmds.length - 1].min oldsel = havemove else # Apply the new move entry[1] = newmove