Should not have more than one active homunculus.
This commit is contained in:
parent
a8aa70be4b
commit
02d39de7f1
@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.l2jmobius.gameserver.network.clientpackets.homunculus;
|
package org.l2jmobius.gameserver.network.clientpackets.homunculus;
|
||||||
|
|
||||||
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.network.PacketReader;
|
import org.l2jmobius.commons.network.PacketReader;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
import org.l2jmobius.gameserver.model.homunculus.Homunculus;
|
import org.l2jmobius.gameserver.model.homunculus.Homunculus;
|
||||||
@ -49,7 +50,8 @@ public class RequestExActivateHomunculus implements IClientIncomingPacket
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (activeChar.getHomunculusList().size() == 0)
|
final int size = activeChar.getHomunculusList().size();
|
||||||
|
if (size == 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -60,6 +62,29 @@ public class RequestExActivateHomunculus implements IClientIncomingPacket
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < Config.MAX_HOMUNCULUS_COUNT; i++)
|
||||||
|
{
|
||||||
|
if (size <= i)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
final Homunculus homu = activeChar.getHomunculusList().get(i);
|
||||||
|
if (homu == null)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (homu.isActive())
|
||||||
|
{
|
||||||
|
homu.setActive(false);
|
||||||
|
activeChar.getHomunculusList().update(homu);
|
||||||
|
activeChar.getHomunculusList().refreshStats(true);
|
||||||
|
activeChar.sendPacket(new ExShowHomunculusList(activeChar));
|
||||||
|
activeChar.sendPacket(new ExActivateHomunculusResult(false));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (_activate)
|
if (_activate)
|
||||||
{
|
{
|
||||||
if (!homunculus.isActive())
|
if (!homunculus.isActive())
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.l2jmobius.gameserver.network.clientpackets.homunculus;
|
package org.l2jmobius.gameserver.network.clientpackets.homunculus;
|
||||||
|
|
||||||
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.network.PacketReader;
|
import org.l2jmobius.commons.network.PacketReader;
|
||||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||||
import org.l2jmobius.gameserver.model.homunculus.Homunculus;
|
import org.l2jmobius.gameserver.model.homunculus.Homunculus;
|
||||||
@ -49,7 +50,8 @@ public class RequestExActivateHomunculus implements IClientIncomingPacket
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (activeChar.getHomunculusList().size() == 0)
|
final int size = activeChar.getHomunculusList().size();
|
||||||
|
if (size == 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -60,6 +62,29 @@ public class RequestExActivateHomunculus implements IClientIncomingPacket
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < Config.MAX_HOMUNCULUS_COUNT; i++)
|
||||||
|
{
|
||||||
|
if (size <= i)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
final Homunculus homu = activeChar.getHomunculusList().get(i);
|
||||||
|
if (homu == null)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (homu.isActive())
|
||||||
|
{
|
||||||
|
homu.setActive(false);
|
||||||
|
activeChar.getHomunculusList().update(homu);
|
||||||
|
activeChar.getHomunculusList().refreshStats(true);
|
||||||
|
activeChar.sendPacket(new ExShowHomunculusList(activeChar));
|
||||||
|
activeChar.sendPacket(new ExActivateHomunculusResult(false));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (_activate)
|
if (_activate)
|
||||||
{
|
{
|
||||||
if (!homunculus.isActive())
|
if (!homunculus.isActive())
|
||||||
|
Loading…
Reference in New Issue
Block a user