Fixed cubic removal array index out of bounds exception.
This commit is contained in:
		@@ -91,9 +91,9 @@ public final class SummonCubic extends AbstractEffect
 | 
			
		||||
			// If maximum amount is reached, random cubic is removed.
 | 
			
		||||
			// Players with no mastery can have only one cubic.
 | 
			
		||||
			final int allowedCubicCount = (int) effected.getActingPlayer().getStat().getValue(Stats.MAX_CUBIC, 1);
 | 
			
		||||
			final int currentCubicCount = player.getCubics().size() + 1;
 | 
			
		||||
			final int currentCubicCount = player.getCubics().size();
 | 
			
		||||
			// Extra cubics are removed, one by one, randomly.
 | 
			
		||||
			for (int i = 0; i <= (currentCubicCount - allowedCubicCount); i++)
 | 
			
		||||
			for (int i = 0; i <= ((currentCubicCount + 1) - allowedCubicCount); i++)
 | 
			
		||||
			{
 | 
			
		||||
				final int removedCubicId = (int) player.getCubics().keySet().toArray()[Rnd.get(currentCubicCount)];
 | 
			
		||||
				final CubicInstance removedCubic = player.getCubicById(removedCubicId);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user