Please add thisArg to options list of all find methods and pass it to lodash filter.
red_led
@red_led
Posts made by red_led
-
Find* methodsposted in Feature Requests
-
RE: Find dropped energyposted in Technical Issues and Bugs
I think (1) is becouse some type of owerflow. For example creep has 43 energy, 50 energyCapacity and harverts 10 per round. After calling creep.harvest() there will be 3 dropped energy on ground. Next creep gets it from ground and so on... Problem is that there is no way to get 7 energy instaed of 10.
As for (2) i'm not trying to do anything special. Just noticed this strange behaviour.
-
git branchesposted in Feature Requests
It would be great to snap game code braches to git branches. Or just import all github branches and let me choose current active in each game mode (game/simulation/survival)
-
RE: Find dropped energyposted in Technical Issues and Bugs
Arr... Sample code again:
if (creep.carry.energy < creep.carryCapacity) { var energy = creep.pos.findInRange( FIND_DROPPED_ENERGY, 1 ); if (energy.length) { console.log('found ' + energy[0].energy + ' energy at ', energy[0].pos); creep.pickup(energy[0]); } } -
Find dropped energyposted in Technical Issues and Bugs
Have this tines in code:
```js
if (creep.carry.energy < creep.carryCapacity)
{
var energy = creep.pos.findInRange(
FIND_DROPPED_ENERGY,
1
);if (energy.length) { console.log('found ' + energy[0].energy + ' energy at ', energy[0].pos); creep.pickup(energy[0]); } }And noticed 2 bugs: 1) when few creeps harvesting near each other there is often found 1-4 energy 2) after calling ```someCreep.suicide()``` there is NaN energy!