Sign in to follow this  
Cuddles

Affinity Token Bug

Recommended Posts

Ok so new item in the game called Affinity Token which is cool but it seems to not be working 100% as such.

 

So you right click item in game, click claim affinity, choose the skill from list and hit accept. This will increase your affinity in that skill by 1, if you already have the max of 5 in that skill then it simply isn't in the list. Most of the time it works perfectly but on some specific skills it seems to have an issue with updating the affinities live, you do actually get the affinity but the skill tab doesn't print you did and your skills list doesn't show it but you did actually get it and a relog will show that.

 

 

Ok all that is shown in the video. I poked around on the code a little and it seems to be in the Affinities class setAffinity method.

So in there is where the affinity is changed and also is where it decides to update live or not.

Spoiler

  public static void setAffinity(long playerid, int skillnumber, int value, boolean loading)
  {
    found = false;
    Long idl = Long.valueOf(playerid);
    Set<Affinity> affs = (Set)affinities.get(idl);
    if (affs == null)
    {
      affs = new HashSet();
      affinities.put(idl, affs);
    }
    for (Affinity a : affs)
    {
      if (skillNumber == skillnumber)
      {
        found = true;
        number = Math.min(5, value);
        if (!loading)
        {
          setAffinityForSkill(playerid, skillNumber, number);
          updateAffinity(playerid, skillNumber, number);
        }
        return;
      }
    }
    
    value = Math.min(5, value);
    if ((!found) && (!loading))
    {
      createAffinity(playerid, skillnumber, value);
      setAffinityForSkill(playerid, skillnumber, value);
    }
    
    affs.add(new Affinity(skillnumber, value));
  }

 

ok so method is in the spoiler.

loading is always set to false when it is called, so cant be that, if I could throw in some troubleshooting prints it would be very easy to work out issue but yeah that will be up to the Devs to do. My guess and it is only a guess is the ""if (skillNumber == skillnumber)"" is not returning true for some skills which means it doesn't do the update but it still does the add() at the end. For the skillNumber to not be true then that skill affinity isn't in the ""Set<Affinity> affs = (Set)affinities.get(idl);"" but like I said a pure guess.

 

So to sum it up the functionality of it works fine, you do actually get the affinity but it doesn't show until you relog for some skills.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this