DinoDevs / GladiatusCrazyAddon

This was "A browser addon for the Gladiatus browser game."
https://gladiatus.dinodevs.com
GNU General Public License v3.0
41 stars 30 forks source link

Failed to detect enemy - material as secondary drop #419

Closed FrutyX closed 1 year ago

FrutyX commented 2 years ago

Taken from #382.

error3

Confirmed, a secondary drop is causing this errors (very #368 related): And it does look like, that the secondary drop has to be a material, for this error to happen.

Failed to detect enemy url("//gf3.geo.gfsrv.net/cdn29/bac7e539d61a9de6caec21363c2694.jpg")

scd

GreatApo commented 1 year ago

I can't see how this error can happen with the current code. gca_tools.img.resolve("//gf3.geo.gfsrv.net/cdn29/bac7e539d61a9de6caec21363c2694.jpg") returns the enemy, so the error should not appear with the current code.

Can anyone still replicate it?

FrutyX commented 1 year ago

I think Thanos said something like that too, but I am getting it pretty normally (remember, a secondary drop and only a material), basically my error log is spammed with it.

FrutyX commented 1 year ago

And so it goes on... might just disable the console warning.

errors

GreatApo commented 1 year ago

I think Thanos said something like that too, but I am getting it pretty normally (remember, a secondary drop and only a material), basically my error log is spammed with it.

Does running gca_tools.img.resolve("//gf3.geo.gfsrv.net/cdn29/bac7e539d61a9de6caec21363c2694.jpg") in the console return the enemy url?

FrutyX commented 1 year ago

Yeah, it returns the enemy url 'img/npc/4/4_4.jpg', however I am looking at it now as a stored report, maybe the result would be different when it actually occurs, but damn, my UW costume just expired :D.

GreatApo commented 1 year ago

Yeah, it returns the enemy url 'img/npc/4/4_4.jpg', however I am looking at it now as a stored report, maybe the result would be different when it actually occurs, but damn, my UW costume just expired :D.

Still throws an error?

FrutyX commented 1 year ago

Not when looking at an old stored report.

GreatApo commented 1 year ago

Not when looking at an old stored report.

I think it works :P

FrutyX commented 1 year ago

Wait what? What works? :D I mean it works, but it's still throwing an error, except when looking at the report later.

GreatApo commented 1 year ago

Wait what? What works? :D I mean it works, but it's still throwing an error, except when looking at the report later.

Oh, sorry, yes it doesn't check the data if the report is old.

Edit the report.js line 187 and completely delete the check if (timePassed > 5) return; Then check the old report.

FrutyX commented 1 year ago

Hello there.

enemy

GreatApo commented 1 year ago

Hello there.

enemy

I still can't see how this error is generated... What do you get with:

let image = document.getElementById('defenderAvatar11').getElementsByTagName('div')[2].style.backgroundImage;
let enemy = gca_tools.img.resolve(image);
if (enemy) console.log('Passed', image);
else console.error('Failed to detect enemy', image, enemy);
FrutyX commented 1 year ago

enemy2

FrutyX commented 1 year ago

I am only eager to see if you can solve this, because it seems even Thanos just ignored this :D.

GreatApo commented 1 year ago

I am only eager to see if you can solve this, because it seems even Thanos just ignored this :D.

The error was extremally misleading :P Test this fix (keep that check deleted and check the old report)

FrutyX commented 1 year ago

PATCHED!

Well done, and thank you. It seems it's gone, I hope, forever, gone, reduced to atoms. (yes I deleted the check again)

GreatApo commented 1 year ago

PATCHED!

Well done, and thank you. It seems it's gone, I hope, forever, gone, reduced to atoms. (yes I deleted the check again)

This will do for now... Ultimately, instead of deleting the url("...."), I should search for the url in the parenthesis... anyway, let's close this for now.

FrutyX commented 1 year ago

Ah lovely, I had 3 expeditions left without UW costume, and last exp gave me a secondary material drop, no error, perfect.