Ticket #3142: ticket3142.diff

File ticket3142.diff, 1.0 KB (added by mimo, 5 years ago)
  • binaries/data/mods/public/simulation/components/ProductionQueue.js

     
    542542            var ent = Engine.AddEntity(templateName);
    543543            this.entityCache.push(ent);
    544544
     545            var cmpNewOwnership = Engine.QueryInterface(ent, IID_Ownership);
     546            cmpNewOwnership.SetOwner(cmpOwnership.GetOwner());
     547
    545548            // Decrement entity count in the EntityLimits component
    546549            // since it will be increased by EntityLimits.OnGlobalOwnershipChanged function,
    547550            // i.e. we replace a 'trained' entity to an 'alive' one
     
    566569    for (var i = 0; i < count; ++i)
    567570    {
    568571        var ent = this.entityCache[0];
    569         var cmpNewOwnership = Engine.QueryInterface(ent, IID_Ownership);
    570         cmpNewOwnership.SetOwner(cmpOwnership.GetOwner());
    571572
    572573        if (cmpAutoGarrison && cmpAutoGarrison.PerformGarrison(ent))
    573574        {