Ticket #3769: patch_commands_js.diff
File patch_commands_js.diff, 1.3 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/simulation/helpers/Commands.js
953 953 } 954 954 955 955 var cmpTechnologyManager = QueryPlayerIDInterface(player, IID_TechnologyManager); 956 957 956 if (!cmpTechnologyManager.CanProduce(cmd.template)) 958 957 { 959 958 if (g_DebugCommands) … … 969 968 Engine.DestroyEntity(ent); 970 969 } 971 970 972 // We need the cost after tech modifications971 // We need the cost after tech and aura modifications 973 972 // To calculate this with an entity requires ownership, so use the template instead 974 973 var cmpTemplateManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager); 975 974 var template = cmpTemplateManager.GetTemplate(foundationTemplate); 976 975 var costs = {}; 976 977 977 for (var r in template.Cost.Resources) 978 978 { 979 costs[r] = +template.Cost.Resources[r]; 980 if (cmpTechnologyManager) 981 costs[r] = cmpTechnologyManager.ApplyModificationsTemplate("Cost/Resources/"+r, costs[r], template); 979 costs[r] = ApplyValueModificationsToTemplate("Cost/Resources/"+r, +template.Cost.Resources[r], cmpPlayer.GetPlayerID(), template); 982 980 } 983 981 984 982 if (!cmpPlayer.TrySubtractResources(costs))