mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-07-31 01:15:57 -04:00
Changed respec code to get the objectId from SetProfessionTemplate
This commit is contained in:
@@ -719,7 +719,7 @@ public class PlayerService implements INetworkDispatch {
|
||||
return;
|
||||
}
|
||||
|
||||
if (profession == null || !Professions.isProfession(profession)) {
|
||||
if (profession == null || !Professions.isProfession(profession) || player.getProfession().equals(profession)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -323,25 +323,8 @@ public class SkillService implements INetworkDispatch {
|
||||
|
||||
SetProfessionTemplate profTemplate = new SetProfessionTemplate();
|
||||
profTemplate.deserialize(buffer);
|
||||
String profession = profTemplate.getProfession();
|
||||
|
||||
Client client = core.getClient(session);
|
||||
if(client == null) {
|
||||
System.out.println("NULL Client");
|
||||
return;
|
||||
}
|
||||
|
||||
if(client.getParent() == null)
|
||||
return;
|
||||
|
||||
CreatureObject creature = (CreatureObject) client.getParent();
|
||||
PlayerObject player = (PlayerObject) creature.getSlottedObject("ghost");
|
||||
|
||||
//System.out.println(profession);
|
||||
if(player == null || player.getProfession().equals(profession) || profession == null)
|
||||
return;
|
||||
|
||||
core.playerService.respec(creature, profession);
|
||||
core.playerService.respec((CreatureObject) core.objectService.getObject(profTemplate.getCharacterId()), profTemplate.getProfession());
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user