Open AnotherSeawhite opened 6 months ago
Unable to reproduce on MSVC build
Your uploaded save appears to be corrupted, it downloads as a 0KB file. Please try uploading it again, there may be other conditions required to induce the crash.
That said, the likely problem appears to be here:
index 7eee88c9ba..9938bb706d 100644
--- a/src/iuse_actor.cpp
+++ b/src/iuse_actor.cpp
@@ -265,6 +265,10 @@ std::optional<int> iuse_transform::use( Character *p, item &it, const tripoint &
}
}
+ if( it.is_tool() ) {
+ result = scale;
+ }
+
if( it.count_by_charges() != target->count_by_charges() && it.count() > 1 ) {
item take_one = it.split( 1 );
do_transform( p, take_one, variant_type );
@@ -273,9 +277,6 @@ std::optional<int> iuse_transform::use( Character *p, item &it, const tripoint &
do_transform( p, it, variant_type );
}
- if( it.is_tool() ) {
- result = scale;
- }
return result;
}
It's checking is_tool() on it
(the item to be transformed) after the item has been transformed. The item no longer exists, game explodes.
This patch simply moves the check to before the transformation, when we know the item still exists.
Is it corrupted? Aw man, I hate Android sometimes. I'll try to upload it again when I get back home.
Describe the bug
Activating worn collapsed telescoping umbrella crashes the game.
Attach save file
Test-trimmed.tar.gz
Steps to reproduce
Expected behavior
I expected the character to either: refuse activating it automatically wield it have an umbrella integrated into the body and not crash
Screenshots
No response
Versions and configuration
Additional context
crash.log