All pastes #544782 Raw Edit

Something

public text v1 · immutable
·published 2007-06-06 16:15 UTC
rendered paste body
public void addVisibleObject(L2Object object, @SuppressWarnings("unused") L2WorldRegion newRegion, L2Character dropper)
    {
        // If selected L2Object is a L2PcIntance, add it in L2ObjectHashSet(L2PcInstance) _allPlayers of L2World
    	// XXX TODO: this code should be obsoleted by protection in putObject func...
        if (object instanceof L2PcInstance)
        {
            L2PcInstance player = (L2PcInstance) object;
            
            L2PcInstance tmp = _allPlayers.get(player.getName().toLowerCase());
            if(tmp!= null)
            {
                _log.warning("Duplicate character!? Closing both characters ("+player.getName()+")");
                player.closeNetConnection();
                tmp.closeNetConnection();
                return;
            }
            
            _allPlayers.put(player.getName().toLowerCase(), player);            
        }