-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 for #8602 #8680
Fix for #8602 #8680
Conversation
@@ -517,6 +517,7 @@ bool map::process_fields_in_submap( submap *const current_submap, | |||
bool destroyed = false; //Is the item destroyed? | |||
// Volume, Smoke generation probability, consumed items count | |||
int vol = 0, smoke = 0, consumed = 0; | |||
// Needs to consume at least cur->getFieldDensity() * 2 | |||
for (auto it = items_here.begin(); it != items_here.end() && | |||
consumed < cur->getFieldDensity() * 2;) { | |||
// Stop when we hit the end of the item buffer OR we consumed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should it be &&, like it is now, or ||, like it says in the comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never mind, read it wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hate it when I read things wrong. np. ;-)
When a fire consumes x units of y ammo it just stops considering burning more y to get |
one-item-consume-once-only problem
Found that oxidizer powder on fire causes a segfault (on master, so it's not from this), will try to fix this too gdb stack trace:
|
// the ammos damage in force, for each bullet, | ||
// just creating shrapnel. | ||
g->explosion( x, y, ammo_type->damage / 2, | ||
true, false, false ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
problem has to do with this function call. will try to figure this out tomorrow.
Other items like birdshot works fine, but oxidizer powder does not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The explosion can destroy items on that place with messes up the item vector and the iterators on it.
The crash was something about oxidizer powder having 0 damage, and trying to create shrapnel using that
Something about fires not consuming ammo type items. #8602