Refactoring and Bugfixes (#127)

* Replacing nil + compact! with delete, delete_at and delete_if wherever possible
* Fixed Terrain Tag editor not setting the correct terrain
* Fixed Text Cursor in Animation Editor not going right
This commit is contained in:
Golisopod-User
2021-08-23 02:55:29 +05:30
committed by GitHub
parent e57e1f4a1e
commit ecc5a040cd
21 changed files with 40 additions and 171 deletions

View File

@@ -184,10 +184,7 @@ def pbManageMysteryGifts
break
elsif cmd==0 # Toggle on/offline
if online.include?(gift[0])
for i in 0...online.length
online[i]=nil if online[i]==gift[0]
end
online.compact!
online.delete(gift[0])
else
online.push(gift[0])
end
@@ -208,10 +205,7 @@ def pbManageMysteryGifts
$Trainer.mystery_gifts.push(gift) if !replaced
pbReceiveMysteryGift(gift[0])
elsif cmd==3 # Delete
if pbConfirmMessage(_INTL("Are you sure you want to delete this gift?"))
master[command]=nil
master.compact!
end
master.delete_at(command) if pbConfirmMessage(_INTL("Are you sure you want to delete this gift?"))
break
end
end
@@ -305,7 +299,7 @@ def pbDownloadMysteryGift(trainer)
pbMessageDisplay(sprites["msgwindow"],_INTL("The gift has been received!")) { sprite.update }
pbMessageDisplay(sprites["msgwindow"],_INTL("Please pick up your gift from the deliveryman in any Poké Mart.")) { sprite.update }
trainer.mystery_gifts.push(gift)
pending[command]=nil; pending.compact!
pending.delete_at(command)
opacityDiff = 16*20/Graphics.frame_rate
loop do
Graphics.update