Browse Source

Merge remote-tracking branch 'origin/refinement-fix' into post-wipe-merge

master
MagicBot 2 years ago
parent
commit
9e6c96a487
  1. 16
      src/engine/net/client/msg/RefineMsg.java
  2. 1
      src/engine/objects/CharacterPower.java

16
src/engine/net/client/msg/RefineMsg.java

@ -10,13 +10,17 @@ @@ -10,13 +10,17 @@
package engine.net.client.msg;
import engine.gameManager.PowersManager;
import engine.gameManager.SessionManager;
import engine.net.*;
import engine.net.client.ClientConnection;
import engine.net.client.Protocol;
import engine.objects.*;
import engine.powers.PowersBase;
import engine.server.MBServerStatics;
import java.util.ArrayList;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public class RefineMsg extends ClientNetMsg {
@ -189,6 +193,18 @@ public class RefineMsg extends ClientNetMsg { @@ -189,6 +193,18 @@ public class RefineMsg extends ClientNetMsg {
//TODO verify if any skills have this as prereq
//TODO verify if any powers have this as a prereq
//get all players powers
for(CharacterPower power : pc.getPowers().values()){
ArrayList<PowerReq> reqs = PowerReq.getPowerReqsForRune(power.getPowerID());
for (PowerReq req : reqs) {
ConcurrentHashMap<String,CharacterSkill> playerSkills = pc.getSkills();
CharacterSkill playerSkill = playerSkills.get(token);
int currentSkillLevel = playerSkill.getTotalSkillPercet();
if (token == req.getToken() && req.getLevel() == currentSkillLevel) {
return false;
}
}
}
//refine skill
return skill.refine(pc);

1
src/engine/objects/CharacterPower.java

@ -566,6 +566,7 @@ public class CharacterPower extends AbstractGameObject { @@ -566,6 +566,7 @@ public class CharacterPower extends AbstractGameObject {
}
}
}
return true;
}

Loading…
Cancel
Save