Changeset 0f80e75ad3bc135cf584aa7b3e6f74c91464688b

Show
Ignore:
Timestamp:
05/01/07 14:25:35 (2 years ago)
Author:
Christopher Jung <bktheg@web.de>
git-committer:
Christopher Jung <bktheg@web.de> 1178022335 +0200
git-parent:

[679bd9529d0b3a0e457c47aca38b1c4f27320db4]

git-author:
Christopher Jung <bktheg@web.de> 1178022335 +0200
Message:

Flotte landen gefixt

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/net/driftingsouls/ds2/server/modules/schiffplugins/SensorsDefault.java

    rc7fedd5 r0f80e75  
    9090                                        "global.awac",                          ShipTypes.hasShipTypeFlag(datatype, ShipTypes.SF_SRS_AWAC) ); 
    9191 
    92                 int jaegerfleet = -1
     92                List<Integer> fleetlist = null
    9393 
    9494                Map<Integer,SQLResultRow> fleetcache = new HashMap<Integer,SQLResultRow>(); 
     
    651651                                        if( ShipTypes.hasShipTypeFlag(datatype, ShipTypes.SF_JAEGER) && (currentDockID != datas.getInt("id")) ) { 
    652652                                                if( ( ashiptype.getInt("jdocks") > 0 ) && ( datas.getInt("owner") == user.getID() ) ) { 
    653                                                         if( fullcount + 1 <= ashiptype.getInt("jdocks") ) { 
     653                                                        int carrierFullCount = db.first("SELECT count(*) fullcount FROM ships WHERE id>0 AND docked='l ",datas.getInt("id"),"'").getInt("fullcount"); 
     654 
     655                                                        if( carrierFullCount + 1 <= ashiptype.getInt("jdocks") ) { 
    654656                                                                t.set_var("sships.action.land",1); 
    655657                                                                if( data.getInt("fleet") > 0 ) { 
    656                                                                         List<Integer> fleetlist = new ArrayList<Integer>(); 
    657                                                                          
    658658                                                                        boolean ok = true; 
    659                                                                         if( jaegerfleet == -1) { 
     659                                                                        if( fleetlist == null ) { 
     660                                                                                fleetlist = new ArrayList<Integer>(); 
     661                                                                                 
    660662                                                                                SQLQuery tmp = db.query("SELECT id,type,status FROM ships WHERE id>0 AND fleet='"+data.getInt("fleet")+"'"); 
    661663                                                                                while( tmp.next() ) { 
     
    668670                                                                                }                
    669671                                                                                tmp.free(); 
    670                                                                                 if( ok ) jaegerfleet = 1; 
    671                                                                                 else jaegerfleet = 0; 
     672                                                                                if( !ok ) { 
     673                                                                                        fleetlist.clear(); 
     674                                                                                } 
    672675                                                                        } 
    673676 
    674                                                                         if( (jaegerfleet == 1) && (fleetlist.size() <= ashiptype.getInt("jdocks")) ) { 
    675                                                                                 if( fullcount + fleetlist.size() <= ashiptype.getInt("jdocks") ) 
     677                                                                        if( !fleetlist.isEmpty() && (fleetlist.size() <= ashiptype.getInt("jdocks")) ) { 
     678                                                                                if( carrierFullCount + fleetlist.size() <= ashiptype.getInt("jdocks") ) 
    676679                                                                                        t.set_var(      "sships.action.landfleet", 1, 
    677680                                                                                                                "global.shiplist", Common.implode("|",fleetlist) );