7th enemy crash workaround?

Forum for alternative clients, mods & discussions on the same.

7th enemy crash workaround?

Postby gravesmerch » Fri Apr 24, 2026 7:45 pm

after messing with Fightview.java seems you can avoid the crash by keeping lsrel size limited to 6 ?

only tested with frogs, refining needed, will try with slimes later, prepared for KO

create a hidden list to store the extra relations
Code: Select all
public final LinkedList<Relation> lsrelHidden = new LinkedList<Relation>();


in uimsg "new" , limit relations to 6, add others to a secondary list
Code: Select all
if (lsrel.size() < 6)
  lsrel.addFirst(rel);
else
  lsrelHidden.addFirst(rel);


in uimsg "del" , check for hidden relations to restore:
Code: Select all
lsrel.remove(rel);
if (!lsrelHidden.isEmpty()){
  lsrel.add(lsrelHidden.remove());


change getrel() to check if switching from lists is needed :
Code: Select all
private Relation getrel(long gobid) {
    for(Relation rel : lsrel) {
        if(rel.gobid == gobid)
            return(rel);
    }
    if (!lsrel.isEmpty()) {
        for (Relation rel : lsrelHidden) {
            if (rel.gobid == gobid) {
                synchronized (lsrel) {
                    //switch rel from lists
                    Relation switchRel = lsrel.remove();
                    lsrelHidden.addFirst(switchRel);
                    lsrel.addFirst(rel);
                    lsrelHidden.remove(rel);
                    return (rel);
                }
            }
        }
    }
    throw(new Notfound(gobid));
}
gravesmerch
 
Posts: 434
Joined: Thu Sep 08, 2022 6:13 pm

Re: 7th enemy crash workaround?

Postby gravesmerch » Fri Apr 24, 2026 9:30 pm

gravesmerch wrote:will try with slimes later, prepared for KO


had to hunt down 3 loose rocks to spawn a 5-6 headed Slime Dragon, after a couple jabs it grew a couple faces, and I was relieved to realize the workaround still works

I'm not sure all the related variables and game states are 100%, but so far it's avoiding the crash... guess i'll just restart the game after some big fights
gravesmerch
 
Posts: 434
Joined: Thu Sep 08, 2022 6:13 pm

Re: 7th enemy crash workaround?

Postby Nightdawg » Fri Apr 24, 2026 9:53 pm

Tell loftar to prioritize this and ignore jorb's stupid useless features for a week.
Someone already made a PR with a fix, but he has to go over it.

https://github.com/dolda2000/hafen-client/pull/22
User avatar
Nightdawg
 
Posts: 2471
Joined: Fri Feb 28, 2020 12:31 am


Return to The Wizards' Tower

Who is online

Users browsing this forum: Claude [Bot] and 33 guests