Giter Site home page Giter Site logo

csl-emptyit's People

Contributors

keallu avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

csl-emptyit's Issues

Warehouses only ever empty

Hi @keallu,

I noticed that warehouses only ever set to empty, they are never told to fill back up again.

I dug around in the code (note that I know nothing about C#) and I noticed this block:

if (buildingManager.m_buildings.m_buffer[buildingId].Info.m_buildingAI is WarehouseAI)
{
    if (emptying)
    {
        buildingManager.m_buildings.m_buffer[buildingId].Info.m_buildingAI.SetEmptying(buildingId, ref buildingManager.m_buildings.m_buffer[buildingId], true);
    }
    else
    {
        buildingManager.m_buildings.m_buffer[buildingId].Info.m_buildingAI.SetFilling(buildingId, ref buildingManager.m_buildings.m_buffer[buildingId], true);
    }
}

It appears that the if condition on emptying is telling the Warehouse to always empty?

The current code appears to flow like this:

  1. The warehouse is currently emptying if(emptying) - if emptying is true.
  2. The warehouse is instructed to continue emptying SetEmptying - even though it is already emptying.

What I believe may have been the goal:

  1. The warehouse is currently filling up if(!emptying) - if emptying is false.
  2. The warehouse should be instructed to start emptying SetEmptying.

In short, I assume this is a bug. I do however recognise that I may have misunderstood the process that initiates this function. I assume it was called when either an upper or lower threshold is reached. Happy to close the issue if I am completely off track.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.