Ticket #4271: aifix.patch

File aifix.patch, 815 bytes (added by mimo, 8 years ago)
  • binaries/data/mods/public/simulation/ai/petra/headquarters.js

     
    142142
    143143    for (let evt of events.Create)
    144144    {
    145         // Let's check if we have a building set to create a new base.
     145        // Let's check if we have a valuable foundation needing builders quickly
     146        // (normal foundations are taken care in baseManager.assignToFoundations)
    146147        let ent = gameState.getEntityById(evt.entity);
    147         if (!ent || !ent.isOwn(PlayerID))
     148        if (!ent || !ent.isOwn(PlayerID) || ent.foundationProgress() === undefined)
    148149            continue;
    149150
    150151        if (ent.getMetadata(PlayerID, "base") == -1)