Page 1 of 1

Fortress Captains not respawn

Posted: Thu Sep 02, 2010 9:00 am
by deadlyroulette
Hi all :)

I have a problem with fortress and captains. Normaly i see that every 12-13 mins captains function are restored and there are no problem. But... it happens that during a fortress captains not spawn again after that time and on map u can see that all barracks are seized (and is not true, cuz all time i have tested killing only 3 captains, archer, mage and guard captain). When during a fortress something goes wrong, captains never spawn again (only when fortress starts again, but they spawn only first time, never after u kill them).
The problem is "solved" if u restart the server but obviously not seems to be the best solution :P

i think that something happens on /gameserver/model/entity/FortSiege.java at line 635:

Code: Select all

                if (_commanders.get(getFort().getFortId()).isEmpty())                {[...]                }                // schedule restoring doors/commanders respawn                 else if (_siegeRestore == null)                {                    getFort().getSiege().announceToPlayer(new SystemMessage(SystemMessageId.SEIZED_BARRACKS));                    _siegeRestore = ThreadPoolManager.getInstance().scheduleGeneral(new ScheduleSiegeRestore(getFort()), FortSiegeManager.getInstance().getCountDownLength() * 60 * 1000);                }
maybe a problem on "_commanders" array (that contains all commanders/captains)?

Re: Fortress Captains not respawn

Posted: Thu Sep 02, 2010 9:04 am
by Gnacik

Code: Select all

Index: java/com/l2jserver/gameserver/model/entity/FortSiege.java===================================================================--- java/com/l2jserver/gameserver/model/entity/FortSiege.java   (revision 4412)+++ java/com/l2jserver/gameserver/model/entity/FortSiege.java   (working copy)@@ -640,6 +640,7 @@                    if (_siegeRestore != null)                    {                        _siegeRestore.cancel(true);+                       _siegeRestore = null;                    }                    // open doors in main building                    for (L2DoorInstance door : getFort().getDoors()) 
try

Re: Fortress Captains not respawn

Posted: Thu Sep 02, 2010 11:23 am
by UnAfraid
What about the upper lines

Code: Select all

Index: java/com/l2jserver/gameserver/model/entity/FortSiege.java===================================================================--- java/com/l2jserver/gameserver/model/entity/FortSiege.java   (revision 8)+++ java/com/l2jserver/gameserver/model/entity/FortSiege.java   (working copy)@@ -283,9 +283,15 @@            setSiegeDateTime(true); // store suspicious merchant spawn in DB                        if (_siegeEnd != null)+           {                _siegeEnd.cancel(true);+               _siegeEnd = null;+           }            if (_siegeRestore != null)+           {                _siegeRestore.cancel(true);+               _siegeRestore = null;+           }                        if (getFort().getOwnerClan() != null && getFort().getFlagPole().getMeshIndex() == 0)                getFort().setVisibleFlag(true); 
should be looks like that?

Re: Fortress Captains not respawn

Posted: Thu Sep 02, 2010 11:23 am
by JIV
already fixed in freya, for now use gnat's temp patch.

Re: Fortress Captains not respawn

Posted: Thu Sep 02, 2010 11:25 am
by Gnacik
JIV wrote:already fixed in freya, for now use gnat's temp patch.
It's your patch in fact, so thanks to you, not me. :lol:

Re: Fortress Captains not respawn

Posted: Thu Sep 02, 2010 12:15 pm
by UnAfraid
// offtopic
should i add bla = null; after bla.cancel(true); everywhere?

i've think that method cancel making variable null; isn't ?

Re: Fortress Captains not respawn

Posted: Thu Sep 02, 2010 1:46 pm
by deadlyroulette
thz to all, i'll try this night :)