Skip to content
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

hauler_type.Bin is inaccurate #438

Open
lethosor opened this issue Aug 24, 2021 · 4 comments
Open

hauler_type.Bin is inaccurate #438

lethosor opened this issue Aug 24, 2021 · 4 comments

Comments

@lethosor
Copy link
Member

lethosor commented Aug 24, 2021

Originally posted by @ab9rf in #435 (comment)

My research suggests that we should rename Bin to something else. Specifically, StoreItemInHospital jobs increment world.stockpile.num_jobs[Bin], even though a "store in hospital" job never result in anything being actually stored in a bin.

        pjVar38 = job::create();
        piVar42 = local_440;
        pjVar38->job_type = StoreItemInHospital;
...
        world.stockpile.num_jobs.Any = world.stockpile.num_jobs.Any + 1;
        world.stockpile.num_jobs.Bin = world.stockpile.num_jobs.Bin + 1;
@ab9rf
Copy link
Member

ab9rf commented Aug 24, 2021

To my fairly substantial surprise, I note that MSVC tells me that there are zero live references to df::enums::hauler_type::Bin in dfhack C++ code. I also did a search of the published hack/scripts folder and found no references in published Lua or Ruby scripts.

@lethosor
Copy link
Member Author

Isn't labormanager using a hardcoded "4" somewhere in place of it?

@ab9rf
Copy link
Member

ab9rf commented Aug 25, 2021

Isn't labormanager using a hardcoded "4" somewhere in place of it?

Yes. And that's the only code in DFHack I'm aware of that uses world.stockpiles.num_haulers or world.stockpiles.num_jobs at all.

@quietust
Copy link
Member

Turns out DF doesn't even have a "hauler_type" enum, and the arrays in world.stockpile (bay12 storage_handlerst) are simply two flat sets of variables whose names end with "", "_mining", "_wood", "_burial", "_item", "_body", "_food", "_refuse", "_furniture", and "_animals".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants