Cleanup related to setActiveClass boolean removal.

This commit is contained in:
MobiusDevelopment 2019-11-07 17:59:23 +00:00
parent df4a4e1321
commit 975cb74d11
10 changed files with 11 additions and 26 deletions

View File

@ -13415,18 +13415,16 @@ public class PlayerInstance extends Playable
/** /**
* Changes the character's class based on the given class index. <BR> * Changes the character's class based on the given class index. <BR>
* <BR>
* An index of zero specifies the character's original (base) class, while indexes 1-3 specifies the character's sub-classes respectively. * An index of zero specifies the character's original (base) class, while indexes 1-3 specifies the character's sub-classes respectively.
* @param classIndex the class index * @param classIndex the class index
* @return true, if successful
*/ */
public synchronized boolean setActiveClass(int classIndex) public synchronized void setActiveClass(int classIndex)
{ {
if (isInCombat() || (getAI().getIntention() == CtrlIntention.AI_INTENTION_ATTACK)) if (isInCombat() || (getAI().getIntention() == CtrlIntention.AI_INTENTION_ATTACK))
{ {
sendMessage("Impossible switch class if in combat"); sendMessage("Impossible switch class if in combat");
sendPacket(ActionFailed.STATIC_PACKET); sendPacket(ActionFailed.STATIC_PACKET);
return false; return;
} }
// Delete a force buff upon class change. // Delete a force buff upon class change.
@ -13451,7 +13449,7 @@ public class PlayerInstance extends Playable
catch (Exception e) catch (Exception e)
{ {
LOGGER.info("Could not switch " + getName() + "'s sub class to class index " + classIndex + ": " + e); LOGGER.info("Could not switch " + getName() + "'s sub class to class index " + classIndex + ": " + e);
return false; return;
} }
} }
_classIndex = classIndex; _classIndex = classIndex;
@ -13623,8 +13621,6 @@ public class PlayerInstance extends Playable
{ {
getClan().broadcastToOnlineMembers(new PledgeShowMemberListUpdate(this)); getClan().broadcastToOnlineMembers(new PledgeShowMemberListUpdate(this));
} }
return true;
} }
/** /**

View File

@ -10457,13 +10457,12 @@ public class PlayerInstance extends Playable
* An index of zero specifies the character's original (base) class, while indexes 1-3 specifies the character's sub-classes respectively.<br> * An index of zero specifies the character's original (base) class, while indexes 1-3 specifies the character's sub-classes respectively.<br>
* <font color="00FF00"/>WARNING: Use only on subclase change</font> * <font color="00FF00"/>WARNING: Use only on subclase change</font>
* @param classIndex * @param classIndex
* @return
*/ */
public boolean setActiveClass(int classIndex) public void setActiveClass(int classIndex)
{ {
if (!_subclassLock.tryLock()) if (!_subclassLock.tryLock())
{ {
return false; return;
} }
try try
@ -10471,7 +10470,7 @@ public class PlayerInstance extends Playable
// Cannot switch or change subclasses while transformed // Cannot switch or change subclasses while transformed
if (_transformation != null) if (_transformation != null)
{ {
return false; return;
} }
// Remove active item skills before saving char to database // Remove active item skills before saving char to database
@ -10521,7 +10520,7 @@ public class PlayerInstance extends Playable
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not switch " + getName() + "'s sub class to class index " + classIndex + ": " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not switch " + getName() + "'s sub class to class index " + classIndex + ": " + e.getMessage(), e);
return false; return;
} }
} }
_classIndex = classIndex; _classIndex = classIndex;
@ -10617,7 +10616,6 @@ public class PlayerInstance extends Playable
ClassMasterInstance.showQuestionMark(this); ClassMasterInstance.showQuestionMark(this);
} }
} }
return true;
} }
finally finally
{ {

View File

@ -10335,13 +10335,12 @@ public class PlayerInstance extends Playable
* An index of zero specifies the character's original (base) class, while indexes 1-3 specifies the character's sub-classes respectively.<br> * An index of zero specifies the character's original (base) class, while indexes 1-3 specifies the character's sub-classes respectively.<br>
* <font color="00FF00"/>WARNING: Use only on subclase change</font> * <font color="00FF00"/>WARNING: Use only on subclase change</font>
* @param classIndex * @param classIndex
* @return
*/ */
public boolean setActiveClass(int classIndex) public void setActiveClass(int classIndex)
{ {
if (!_subclassLock.tryLock()) if (!_subclassLock.tryLock())
{ {
return false; return;
} }
try try
@ -10349,7 +10348,7 @@ public class PlayerInstance extends Playable
// Cannot switch or change subclasses while transformed // Cannot switch or change subclasses while transformed
if (_transformation != null) if (_transformation != null)
{ {
return false; return;
} }
// Remove active item skills before saving char to database // Remove active item skills before saving char to database
@ -10399,7 +10398,7 @@ public class PlayerInstance extends Playable
catch (Exception e) catch (Exception e)
{ {
LOGGER.log(Level.WARNING, "Could not switch " + getName() + "'s sub class to class index " + classIndex + ": " + e.getMessage(), e); LOGGER.log(Level.WARNING, "Could not switch " + getName() + "'s sub class to class index " + classIndex + ": " + e.getMessage(), e);
return false; return;
} }
} }
_classIndex = classIndex; _classIndex = classIndex;
@ -10495,7 +10494,6 @@ public class PlayerInstance extends Playable
ClassMasterInstance.showQuestionMark(this); ClassMasterInstance.showQuestionMark(this);
} }
} }
return true;
} }
finally finally
{ {

View File

@ -9935,7 +9935,6 @@ public class PlayerInstance extends Playable
sendPacket(new ExStorageMaxCount(this)); sendPacket(new ExStorageMaxCount(this));
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this); EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
return;
} }
finally finally
{ {

View File

@ -9942,7 +9942,6 @@ public class PlayerInstance extends Playable
sendPacket(new ExStorageMaxCount(this)); sendPacket(new ExStorageMaxCount(this));
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this); EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
return;
} }
finally finally
{ {

View File

@ -9927,7 +9927,6 @@ public class PlayerInstance extends Playable
sendPacket(new ExStorageMaxCount(this)); sendPacket(new ExStorageMaxCount(this));
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this); EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
return;
} }
finally finally
{ {

View File

@ -9954,7 +9954,6 @@ public class PlayerInstance extends Playable
sendPacket(new ExStorageMaxCount(this)); sendPacket(new ExStorageMaxCount(this));
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this); EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
return;
} }
finally finally
{ {

View File

@ -9954,7 +9954,6 @@ public class PlayerInstance extends Playable
sendPacket(new ExStorageMaxCount(this)); sendPacket(new ExStorageMaxCount(this));
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this); EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
return;
} }
finally finally
{ {

View File

@ -9848,7 +9848,6 @@ public class PlayerInstance extends Playable
sendPacket(new ExStorageMaxCount(this)); sendPacket(new ExStorageMaxCount(this));
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this); EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
return;
} }
finally finally
{ {

View File

@ -9942,7 +9942,6 @@ public class PlayerInstance extends Playable
sendPacket(new ExStorageMaxCount(this)); sendPacket(new ExStorageMaxCount(this));
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this); EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
return;
} }
finally finally
{ {