When a Android device receives a <img src=icon:undefined> it crashes, so, it's a minor bug, but try to fix it :)
For example, i have a new Mega Evolution like "Mega Ho-Oh" in my server, (i actually have it) a android player can't battle with it because it does get bugged.
Sounds like you would need to modify an android app and apply the image so they can use it. Or maybe, better option, add a condition if the user is using android on server script, make it show default Ho-oh or use outside link to a domain hosting if it supports it.
So, exactly, but instead of avoid the fix, you should do something, in PC the new Megas are just not shown but in Android it makes it crash, and you can distribute the new Version with the corresponding fix, but if i do that not everyone will have acces to the version... so, try to fix it it should be an Infinite loop, and the fix will help all Android people to use and Watch battles without crash
This isn't how the images are displayed in battle for any client. There is code from 2013 to handle missing resources for a pokemon number. It probably crashes due to missing the pokemon in the info files, but I would need to go on the server and crash to find out.
Both, anywhere you get an undefined icon you will be crashed, in battles the Android Client i think, you get the poke, and cause it does not exist in the db, it will be searching forever. In PC it does not happen
are you literally sending <img src=icon:undefined> or are you sending <img src=icon:65786> which is mega ho-oh?
I am not sendin anything, so, i'll take a while to explain my point: 1) Let's start by the point: "<img src=icon:undefined>" crashes Android. 2) In any scenario, battles or chat if an Android receives "<img src=icon:undefined>" it will crash 3) Normally in chat, exceptuating for a mal-programmed script functionality, "<img src=icon:undefined>" should not be sent 4) When a Android receives in battle a pokemon, it does load the icon, but if the icon is undefined, it will loop forever, and the Android will Crash, please fix it qwq i really want to play Mega Mastery and other fun tiers with Android people
Midwaymarshall was asking, are you sending <img src=icon:undefined> or <img src=icon:65786>. It's literally looking for a number. You could put in any number from 0 to infinity and it would work. Granted, only a very small amount of numbers will work (as in, valid dex numbers) otherwise it defaults to the missingno icon. When it receives text, as in "undefined" it doesn't know what to do and crashes. This could mean the data for the new mega pokemon was not set up completely and is missing a value somewhere along the lines.
Again html is not used in battles to display images camilo. But if you are so fixated on the algorithm for html parsing here it is. Two things break getLocalName for icons: a string or a number that is larger than 0x7FFFFFFF or lower than 0x80000000. But getLocalName is wrapped in a try block catching NumberFormatExceptions and StringIndexOutOfBoundsExceptions so it would not cause a crash. Code (java): String source = getLocalName(src); ... int Identifier = resources.getIdentifier(source, "drawable", pkgName); if (Identifier == 0) { // If it's 0 it means it could not locate the resource return getResource("pi_0"); // And defaults to missingo's icon } else { // Otherwise retrieve image from resources Drawable drawable = resources.getDrawable(Identifier); drawable.setBounds(0,0,drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight()); return drawable; } private String getLocalName(String src) { ... if (src.indexOf("icon:") == 0) { int i = Integer.parseInt(src.replace("icon:", "")); int j = i >> 16; i = i - (j << 16); return "pi_" + i + (j == 0 ? "" : "_" + j); } ... } I tried to find a battle with mega mastery for awhile on Pokemon Espanol but didn't.
Okay how about this @Camilo You start a mega mastery battle on Pokemon Espanol with mega arbok or w/e out and don't make any moves while I debug my android phone so I can fix this problem.
I watched an entire mega mastery battle without crashing. It did go a little crazy at points as well as not giving any custom pokemon names Spoiler: Image
Can you send me a link to the mod? I think the error is with instantiating the shallowbattlepoke class, which would explain why the level shows 0 (because thats the default value without constructors) Also I'm playing android 2.6.1, that would be why I'm not crashing
On the latest version it handled the errors without crashing. I got tired of trying to find players to help me debug the issue and no one seemed to know where the download to the mod was so I could test it myself by desktop. It could be throwing an error from ShallowBattlePoke::39 and may be amended by changing PokemonInfo::101 to return pokeNames.get(num, "Default Value"); ShallowBattlePoke::50&51 also make database calls but they seem to be better guarded against null entries But it was a generally unhelpful situation for me to resolve.