-
Notifications
You must be signed in to change notification settings - Fork 290
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
Fixes for active transforming ter/furn, add grid-powered space heaters #1204
Fixes for active transforming ter/furn, add grid-powered space heaters #1204
Conversation
Doesn't happen until you reload the map with an active heater in it. It could check map bounds and specifically call map's version for those, but it doesn't do that at the moment.
It unconditionally adds the new point to the vector, regardless of whether |
Oh, so when I saved the game and tested editing the JSON, that's what fixed it, not the JSON edit itself? Well crap, that means the feature won't actually work right as intended. I'll go ahead and close this for now, since not sure how easy it'd be to fix. |
So after some source-diving to look into what makes this tick, it took some talking with Kheir on the discord and giving this PR a second look to realize I missed something absolutely critical in my JSON: the Time to reopen, get this fixed up, then give it a second test. |
Wait no, the active version DOES have the correct flag. I'm still going to look at this but we'll see if I get results or not. |
Found the cause: |
I need to figure out how to make tripoint_abs_sm p_abs_sm;
point_sm_ms p_within_sm;
std::tie( p_abs_sm, p_within_sm ) = project_remain<coords::sm>( qt.p );
submap *sm = mb.lookup_submap( p_abs_sm );
if( sm == nullptr ) {
return;
}
const furn_t &old_t = sm->get_furn( p_within_sm.raw() ).obj();
const furn_t &new_t = qt.id.obj();
sm->set_furn( p_within_sm.raw(), qt.id ); I figured out I need to replace EDIT: What seems to be exactly what I'm after is already defined later in the function, just buried in an if statement. Will test in a bit. |
Couldn't get it to break, so it's probably working. It's a bit late to demand proper test cases, I'll do it next time. |
Alright. I'm still worried about the test failure you mentioned in #2187, since this is the PR that changes the code likely to cause it. |
Summary
SUMMARY: Content "Fix charge_watcher transformation skipping important functions, add grid-powered space heaters"
Purpose of change
Per my musings while messing with vehicle heaters, I realized we now have what's needed to allow for installing grid heaters. Well, after a while of leaving this PR on hold as I didn't realize why heaters weren't emitting heat, @KheirFerrum and I both started looking through functions and found out the relevant function was skipping
furn_set
in favor ofset_furn
.Describe the solution
grid_furn_transform_queue::apply
in distribution_grid.cpp to correctly feed the needed info tofurn_set
instead ofset_furn
, so it won't skip out on important functions like updating emissions. Also makes use of a tripoint Kheir spotted that was exactly what I needed to get it working, which was previously buried in an if block.charge_watcher
andsteady_consumer
. When active they consume the same power that their item counterparts are set to and produce the same emission.Describe alternatives you've considered
Rigging up constructable air conditioners could be added too, maybe?
Testing
Additional context
Tile symbol and color evidently aren't carried across by copy-from, nice.