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

Fix/window disassembly fail #6110

Merged
merged 11 commits into from Feb 16, 2014

Conversation

Projects
None yet
3 participants
@terribleperson
Copy link
Contributor

commented Feb 15, 2014

This should fix the bug where disassembly of certain furniture and terrain does not work.

if (g->m.has_furn(p.x, p.y)) {
std::string furn_here = g->m.get_furn(p.x, p.y);
g->add_msg(_("You disassemble the %s."), g->m.furnname(p.x, p.y).c_str());
if(furn_here == "f_makeshift_bed" || furn_here == "" || furn_here == "f_beg" || furn_here == "f_armchair" || furn_here == "f_sofa") {

This comment has been minimized.

Copy link
@KA101

KA101 Feb 15, 2014

Contributor

f_beg -> f_bed, I think.

@KA101

This comment has been minimized.

Copy link
Contributor

commented Feb 15, 2014

Looks good otherwise. Fix and I'll pull for testing.

} else if(ter_here == "t_blackboard") {
g->m.spawn_item(p.x, p.y, "2x4", 4);
g->m.spawn_item(p.x, p.y, "nail", 0, rng(6,10));
g->m.ter_set(p.x, p.y, t_pavement);

This comment has been minimized.

Copy link
@KA101

KA101 Feb 15, 2014

Contributor

Oddly enough, the backboard is now immune to disassembly. Same symptoms as the windows.

} else if(ter_here == "t_rdoor_c" || ter_here == "t_rdoor_o") {
g->m.spawn_item(p.x, p.y, "2x4", 24);
g->m.spawn_item(p.x, p.y, "nail", 0, rng(36,48));
g->m.ter_set(p.x, p.y, t_door_c);

This comment has been minimized.

Copy link
@KA101

KA101 Feb 15, 2014

Contributor

Can't take down doors either. :-/

Sorry, man.

g->m.spawn_item(p.x, p.y, "cable", rng(1,15));
g->m.spawn_item(p.x, p.y, "cu_pipe", rng(2,5));
g->m.furn_set(p.x, p.y, f_null);
} else if(furn_here == "f_dryer") {

This comment has been minimized.

Copy link
@KA101

KA101 Feb 15, 2014

Contributor

Dryers ain't happening either, though they (like doors) simply refuse disassembly, whereas the backboard takes time & says it's disassembled but nothing happens.

g->m.spawn_item(p.x, p.y, "element", rng(1,4));
g->m.spawn_item(p.x, p.y, "pilot_light", 1);
g->m.furn_set(p.x, p.y, f_null);
} else if(furn_here == "f_fridge") {

This comment has been minimized.

Copy link
@KA101

KA101 Feb 15, 2014

Contributor

Fridge worked fine though.

g->m.spawn_item(p.x, p.y, "cable", rng(1,15));
g->m.spawn_item(p.x, p.y, "element", rng(1,3));
g->m.furn_set(p.x, p.y, f_null);
} else if(furn_here == "f_exercise") {

This comment has been minimized.

Copy link
@KA101

KA101 Feb 15, 2014

Contributor

Exercise machine was within parameters.

@terribleperson

This comment has been minimized.

Copy link
Contributor Author

commented Feb 15, 2014

Not being able to take down doors, dryers, washers, or anything else that simply refuses disassembly is expected behaviour. They lack the DECONSTRUCT flag, and this fix simply attempts to return behaviour to where it was prior to Rivet's additions. I'm working on moving disassembly data to the jsons, but that'll be a different PR. The backboard, though... apparently I had it as 'blackboard'. That should be fixed now. Does anything else have the same behavior as the windows or backboard?

@KA101

This comment has been minimized.

Copy link
Contributor

commented Feb 16, 2014

OK, so we give doors the DECONSTRUCT flag as they're trivial to dismount given a hammer and screwdriver. I can do it IRL and I claim at most 1 point in Construction. (Knock out the hinge pins, take the door out of the hinges, remove hinges & optionally latch-receptor, BAM deconstructed.)

@terribleperson

This comment has been minimized.

Copy link
Contributor Author

commented Feb 16, 2014

Since it was that way once upon a time, fair enough. Done.

@KA101 KA101 self-assigned this Feb 16, 2014

if (g->m.has_furn(p.x, p.y)) {
std::string furn_here = g->m.get_furn(p.x, p.y);
g->add_msg(_("You disassemble the %s."), g->m.furnname(p.x, p.y).c_str());
if(furn_here == "f_makeshift_bed" || furn_here == "" || furn_here == "f_bed" || furn_here == "f_armchair" || furn_here == "f_sofa") {

This comment has been minimized.

Copy link
@kevingranade

kevingranade Feb 16, 2014

Member

what's up with:
furn_here == ""
?

@kevingranade kevingranade merged commit 5cccff2 into CleverRaven:master Feb 16, 2014

1 check passed

default
Details

@terribleperson terribleperson deleted the terribleperson:fix/window-disassembly-fail branch Jun 8, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.