Question regarding spoil methods

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
sahar
Posts: 582
Joined: Mon Jun 20, 2011 2:40 pm
Contact:

Question regarding spoil methods

Post by sahar »

In L2Attackable is there a reason we got this:

Code: Select all

	private boolean _isSpoil = false;
	private int _isSpoiledBy = 0;
	
	public boolean isSpoil()
	{
		return _isSpoil;
	}
	
	public void setSpoil(boolean isSpoil)
	{
		_isSpoil = isSpoil;
	}
	
	public final int getIsSpoiledBy()
	{
		return _isSpoiledBy;
	}
	
	public final void setIsSpoiledBy(int value)
	{
		_isSpoiledBy = value;
	}
Rather than just this:

Code: Select all

	private int _isSpoiledBy = 0;
	
	public boolean isSpoil()
	{
		return _isSpoiledBy > 0;
	}
	
	public final int getIsSpoiledBy()
	{
		return _isSpoiledBy;
	}
	
	public final void setIsSpoiledBy(int value)
	{
		_isSpoiledBy = value;
	}
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Question regarding spoil methods

Post by jurchiks »

That's called "Advanced coding skills" :D
Anyway, it should be _spoiledBy, "is" prefix is meant for boolean variables/methods only (like isSpoil()).
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
sahar
Posts: 582
Joined: Mon Jun 20, 2011 2:40 pm
Contact:

Re: Question regarding spoil methods

Post by sahar »

Another thing I came accross, if x do y and then do y again anyway...

Code: Select all

if (stackedInfo.getSkill().isAbnormalInstant())
{
	stopSkillEffects(false, skill.getAbnormalType());
}
stopSkillEffects(false, skill.getAbnormalType());
in CharEffectList.java
Sdw
L2j Veteran
L2j Veteran
Posts: 855
Joined: Mon May 03, 2010 8:38 am
Location: France

Re: Question regarding spoil methods

Post by Sdw »

Dude you don't know what you just did :D
sahar
Posts: 582
Joined: Mon Jun 20, 2011 2:40 pm
Contact:

Re: Question regarding spoil methods

Post by sahar »

Huh? is it bad? ;p
Post Reply