Ticket #2629: ResourceModify.4.patch
File ResourceModify.4.patch, 1.7 KB (added by , 9 years ago) |
---|
-
binaries/data/mods/public/simulation/ai/common-api/entity.js
376 376 resourceDropsiteTypes: function() { 377 377 if (!this.get("ResourceDropsite")) 378 378 return undefined; 379 return this.get("ResourceDropsite/Types").split(/\s+/); 379 380 if (!this.get("ResourceDropsite/Types")) 381 return []; 382 383 return (this.get("ResourceDropsite/Types")).split(/\s+/); 380 384 }, 381 385 382 386 -
binaries/data/mods/public/simulation/components/ResourceDropsite.js
3 3 ResourceDropsite.prototype.Schema = 4 4 "<element name='Types'>" + 5 5 "<list>" + 6 "< oneOrMore>" +6 "<zeroOrMore>" + 7 7 "<choice>" + 8 8 "<value>food</value>" + 9 9 "<value>wood</value>" + … … 10 10 "<value>stone</value>" + 11 11 "<value>metal</value>" + 12 12 "</choice>" + 13 "</ oneOrMore>" +13 "</zeroOrMore>" + 14 14 "</list>" + 15 15 "</element>"; 16 16 … … 18 18 /** 19 19 * Returns the list of resource types accepted by this dropsite. 20 20 */ 21 21 22 ResourceDropsite.prototype.GetTypes = function() 22 23 { 23 return this.template.Types.split(/\s+/); 24 this.types = ApplyValueModificationsToEntity("ResourceDropsite/Types", this.template.Types, this.entity); 25 26 return this.types === "" ? [] : this.types.split(/\s+/); 24 27 }; 25 28 26 29 /**