-
Notifications
You must be signed in to change notification settings - Fork 155
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
bug fix #393
bug fix #393
Conversation
kahojyun
commented
Sep 9, 2017
- don't remove border walls placed by system
- repairer stuck when there are system walls in room
- Memory initialize
- fix carry withdrawing energy from base storage
- carry helper shouldn't transfer to creeps in targetRoom
A new review, yeah.
|
A new review, yeah.
|
A new review, yeah.
|
src/prototype_creep_resources.js
Outdated
@@ -297,7 +303,8 @@ Creep.prototype.transferToCreep = function(direction) { | |||
const creeps = adjacentPos.lookFor('creep'); | |||
for (let i = 0; i < creeps.length; i++) { | |||
const otherCreep = creeps[i]; | |||
if (!checkCreepForTransfer(otherCreep)) { | |||
// don't transfer to other base's creep, fix carry helper | |||
if (!checkCreepForTransfer(otherCreep) || otherCreep.memory.base !== this.memory.base) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the best approach. Maybe fixes the current issue.
I had a couple of cases where the external rooms of different base rooms are crossing each other and it doesn't matter to which room the energy is transferred.
I think the better approach would be checking for the direction. helper
is the newest sort of carry usage, maybe we should rethink that, add a value to the memory to be able to check for them, have a different role type, ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about this.memory.helper && !otherCreep.memory.helper && otherCreep.memory.base !== this.memory.base
?
In fact, I disabled transfer to carry in PR #403. I don't think it necessary to allow energy transfer between carries because it will mess up carry's routing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this approach is better. We can also restrict, that helpers can only transfer to helpers, carries only to carries that should be fine.
Not sure if I understand your last sentence
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check out the new commit plz :)
I'm sorry for my poor English if my last sentence confuse you... I found that carries near pathStart
will get energy from other carries and not move to their own target. This problem is obvious in low RCL rooms. I just forbade energy transfer between carries in my scripts so that every carry can reach their targets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the changes I like, an exception is the transfer to other creeps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
A new review, yeah.
|