-
Notifications
You must be signed in to change notification settings - Fork 284
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
Misc fixes for explosions and radio activation #1326
Misc fixes for explosions and radio activation #1326
Conversation
You could also look through CleverRaven/Cataclysm-DDA#54213, CleverRaven/Cataclysm-DDA#45661, CleverRaven/Cataclysm-DDA#47066, or CleverRaven/Cataclysm-DDA#47192 to see if there's anything you could salvage. |
- Switch explosion_queue to use std::deque - Remove limit on radio activation range - Activate items on all z-levels - Fix GCC build - Satisfy tidy
(cherry picked from commit 581e87c190d93ccb30dc301286f84603dc7acdee)
Thanks for the tip! Cherry-picked crafting changes, the rest I don't think applies. Already covered by this PR. Don't know what to think about this, I kinda like how technicians "swallow" items and force you to kill them. Also out of scope, but looks neat, will throw on the to-do list. |
@@ -807,6 +859,37 @@ float blast_radius_from_legacy( int power, float distance_factor ) | |||
( std::log( 0.75f ) / std::log( distance_factor ) ); | |||
} | |||
|
|||
explosion_queue &get_explosion_queue() | |||
{ | |||
static explosion_queue singleton; |
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.
Would be nicer if it was in game
or some other tracker instead of the anti-pattern thing.
Now, game
is a god class, but the number of anti-patterns would remain the same instead of being +1'd.
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.
Yeah, game
would've been a better place for this, but that haven't crossed my mind back then.
process_item_valptr( armor_item, *this ); | ||
process_item_valptr( tack_item, *this ); | ||
process_item_valptr( tied_item, *this ); | ||
} |
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.
Why is it not just using visit
to go through all the items?
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.
Item processing can result in item being destroyed. visit_items
does not allow erasing while visiting, and remove_items_with
does not allow modifying (processing) items while visiting and optionally erasing.
It'd either require storing item references, and then erasing them in a separate pass while keeping track of erasure order (because inv
is std::vector
), or extending visitable
with a new method and implementing it for all visitable classes, and this PR already felt overbloated.
Flashbang, | ||
ResonanceCascade, | ||
Shockwave | ||
}; |
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.
Not snake_cased
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.
Argh, I did it again
All the issues I have with it are minor enough. It would be nice if they were fixed, but there's no rush. |
Purpose of change
RADIO_ACTIVATION
flag not actually being activated (fixes radio activation mod problem #1276)Describe the solution
RADIO_ACTIVATION
flag, makeRADIO_INVOKE_PROC
flag set charges of resulting item to 0, so that the next iuse (e.g. explosion) will be invoked when item is processed on next turn.max_charges
to the mininukeRADIO_CONTROLLED
flagTesting
Mostly for the exact scenarios described in the bugreports and bug descriptions.
Additional context
Explosions seem to semi-reliably produce vehicles that have 0 as their cached mass, which results in division by zero and debugmsg informing player of "vehicle with negative drag".