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 for #8602 #8680

Merged
merged 3 commits into from
Aug 26, 2014
Merged

Conversation

EpicOrange
Copy link
Contributor

Something about fires not consuming ammo type items. #8602

@@ -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
Copy link
Contributor Author

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?

Copy link
Contributor Author

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

Copy link
Contributor

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. ;-)

@EpicOrange EpicOrange changed the title Fix for #8602 [wip] Fix for #8602 Aug 25, 2014
@EpicOrange
Copy link
Contributor Author

When a fire consumes x units of y ammo it just stops considering burning more y to get consumed to the maximum, will fix that now

one-item-consume-once-only problem
@EpicOrange
Copy link
Contributor Author

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:

#1 0x0094fd45 in item::typeId (this=0x810dd210) at src/item.cpp:3034
#2 0x00947b17 in item::volume (this=0x810dd210, unit_value=false, precise_value=false) at src/item.cpp:1478
#3 0x007150d2 in map::process_fields_in_submap (this=0xffe400a8, current_submap=0x810ed970, submap_x=3, submap_y=5) at src/field.cpp:525
#4 0x007149b3 in map::process_fields (this=0xffe400a8) at src/field.cpp:358
#5 0x00560c13 in game::do_turn (this=0xffe40008) at src/game.cpp:1410
#6 0x00914027 in main (argc=0, argv=0x28ac10) at src/main.cpp:294

// the ammos damage in force, for each bullet,
// just creating shrapnel.
g->explosion( x, y, ammo_type->damage / 2,
true, false, false );
Copy link
Contributor Author

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

Copy link
Contributor

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
@EpicOrange EpicOrange changed the title [wip] Fix for #8602 Fix for #8602 [ready] Aug 26, 2014
@kevingranade kevingranade merged commit 96dae03 into CleverRaven:master Aug 26, 2014
@EpicOrange EpicOrange deleted the burning-stackables-fix branch August 26, 2014 22:30
@kevingranade kevingranade changed the title Fix for #8602 [ready] Fix for #8602 Sep 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants