Made more use of nil_or_empty?, fixed incorrect default species body shape, fixed Illusion, fixed potential foreign Pokémon with blank names

This commit is contained in:
Maruno17
2021-05-03 17:34:19 +01:00
parent 8e6ee21c20
commit 474281712b
30 changed files with 71 additions and 73 deletions

View File

@@ -138,7 +138,7 @@ def pbManageMysteryGifts
pbMessageDisplay(msgwindow,_INTL("Searching for online gifts...\\wtnp[0]"))
online = pbDownloadToString(MysteryGift::URL)
pbDisposeMessageWindow(msgwindow)
if online==""
if nil_or_empty?(online)
pbMessage(_INTL("No online Mystery Gifts found.\\wtnp[20]"))
online=[]
else
@@ -245,7 +245,7 @@ def pbDownloadMysteryGift(trainer)
sprites["msgwindow"]=pbCreateMessageWindow
pbMessageDisplay(sprites["msgwindow"],_INTL("Searching for a gift.\nPlease wait...\\wtnp[0]"))
string = pbDownloadToString(MysteryGift::URL)
if string==""
if nil_or_empty?(string)
pbMessageDisplay(sprites["msgwindow"],_INTL("No new gifts are available."))
else
online=pbMysteryGiftDecrypt(string)
@@ -334,7 +334,7 @@ def pbMysteryGiftEncrypt(gift)
end
def pbMysteryGiftDecrypt(gift)
return [] if gift==""
return [] if nil_or_empty?(gift)
ret = Marshal.restore(Zlib::Inflate.inflate(gift.unpack("m")[0]))
if ret
ret.each do |gift|