Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upBreaking vehicles - ready! #4169
Conversation
ianestrachan
added some commits
Nov 4, 2013
dwarfkoala
referenced this pull request
Nov 5, 2013
Closed
Vehicle parts should be removed from the vehicle given enough bashing. Also Destroyed parts should drop scrap metal on removal. #3797
ianestrachan
referenced this pull request
Nov 6, 2013
Closed
Make smashing glass drop glass shards. #4135
This comment has been minimized.
This comment has been minimized.
|
Either later or in this PR, how about scatterring, or even better flinging |
This comment has been minimized.
This comment has been minimized.
|
Actually, they are scattered when broken off from damage. The Flinging the actual parts around as projectiles would be amazing (and potentially deadly to those standing nearby) but I haven't any idea how to do that. |
This comment has been minimized.
This comment has been minimized.
|
Going to beef up the amount of metal reclaimed from parts being broken into pieces, going by the weight of the resulting pieces. Scrap metal: 113 No more sheet metal, since anything being smashed from a collision or torn off of a car is unlikely to still be a flat and smooth sheet of metal after that happens. (Also it has 1000 weight, so the lump is better) I'm going to aim for about a 50% reclamation rate with (where possible) at least one of each of scrap/chunks/lumps. |
ianestrachan
added some commits
Nov 7, 2013
This comment has been minimized.
This comment has been minimized.
|
I think we're good to go. I got some segfaults, but I'm certain they're due to a bug that's been fixed since I started this (specifically, not being able to move to the south or east, and not being able to long-range teleport near monsters). I completely smashed a couple of vehicles until they were totally destroyed (serious fun, though explosions are surprisingly bad at taking out vehicles) and didn't seem to have any problems. |
kevingranade
merged commit 9ef8569
into
CleverRaven:master
Nov 9, 2013
1 check passed
ianestrachan
deleted the
ianestrachan:breaking-vehicles
branch
Nov 9, 2013
This comment has been minimized.
This comment has been minimized.
|
I seem to have come across a serious problem with this, in that removing parts actually changes the parts vector. And parts are referred to by their index in the parts vector. And the indices are carried over after removing parts, and then used to remove parts. Specifically unless i'm reading it completely incorrectly, vehicle::damage_direct is removing random parts by removing the part "p" after removing other parts (each of which can of course cause the meaning of "p" to change), and even worse, doing so every iteration while iterating over a list of parts which includes p. If it so happens that "p" is the final part in the parts list, removing any other part causes a segfault when "p" is later removed. Even if it's not, random other parts will be removed. The more i look at the way vehicle parts are handled, the less i want to have anything to do with this. |
ianestrachan commentedNov 5, 2013
Closes #3797:
Should make clearing wreckage easier. I recommend that whoever tests this debugs themselves a sledgehammer and smashes a car into bits; it's surprisingly fun.