-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spawn.spawning.setDirections() unable to change number of directions #108
Comments
If there's a bug here then I think it must be in https://github.com/screeps/engine/pull/61/files#diff-eb4af864dfdce840b68c56247e6cabbfR15 |
If it is in `bulk.update`, its likely this line
https://github.com/screeps/driver/blob/master/lib/bulk.js#L42
…On Sun, Jan 27, 2019 at 10:28 PM sparr ***@***.***> wrote:
If there's a bug here then I think it must be in bulk.update.
https://github.com/screeps/engine/pull/61/files#diff-eb4af864dfdce840b68c56247e6cabbfR15
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#108 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA93DxGNc-Kj0elqba724eJauo0zMRAXks5vHnxrgaJpZM4aVG4l>
.
|
That seems like it. lodash merge won't delete keys that already exist but aren't in the replacement object. I've been away too long and forgotten the architecture here so I'm not sure of an appropriate fix. |
Thanks, I'll take a look |
One fix at the outer level would be to change the spawn directions from a list of 0-8 numbers to an array of 8 true/false values. |
Should be fixed currently. |
I'm having an issue with the setDirections API call. It won't let me decrease the number of directions supplied. For instance if I create a creep via:
spawn.spawnCreep(body, name, { directions: [ TOP, BOTTOM ] });
and then later I performspawn.spawning.setDirections([ LEFT ]);
then the directions that actually get set are:[ LEFT, BOTTOM ]
. It seems like it's merging the old directions and the new ones instead of just overwriting as I would expect.This is happening on a local server, I'm not sure if it happens on MMO as well.
cc: @sparr because you worked on this in #61
The text was updated successfully, but these errors were encountered: