-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Exosuit features no longer work #59657
Comments
First noticed the issue while working on #58670, so approximately 06/24/2022 for a start date. |
I can't make it work on Cataclysm-DDA experimental build 2022-05-02-2346 and I tested with saving and reloading to see if it required a reload like some errors do occasionally. |
irwiss — Today at 6:19 AM From the discord this morning |
What is the status on this one? I see some related PRs, are these still broken? |
I need to sit down and do an item by item check tonight, I'll update or close this as appropriate. |
and also #61701 |
I can't replicate this in vanilla, I see no monster or item called "exosuit" |
These are Aftershock items. |
I tried this with an X-02: 'Grunt' Combat Mech in vanilla. There I saw no strength boost and no protection from cold. |
Ok. This one probably does need fixing for stable unfortunately. I'll see if I can find some time to pin it down tonight somehow |
Isn't this working correctly? I'm getting the strength bonus and some warmth after activating the frame Screencast.from.2022-11-28.07-45-55.webm |
From looking briefly at the code, the vanilla |
The majority of the features seem to be working now. I ran out of time to finish testing tonight but tomorrow I can test the rest and see if I can identify the issues with the non-functional ones. Tested successfully:
Tested but not functioning:
Not yet tested:
|
These all appear to be different and unrelated issues:
Quick and dirty patch; it would be prettier if relic code used item_locationdiff --git a/src/character.h b/src/character.h
index f21a1a2189..a20c4c6759 100644
--- a/src/character.h
+++ b/src/character.h
@@ -1676,6 +1676,10 @@ class Character : public Creature, public visitable
return worn.is_worn( thing );
}
+ bool is_worn_module( const item &thing ) const {
+ return worn.is_worn_module( thing );
+ }
+
/**
* Asks how to use the item (if it has more than one use_method) and uses it.
* Returns true if it destroys the item. Consumes charges from the item.
diff --git a/src/character_attire.cpp b/src/character_attire.cpp
index 6156574d35..5daef15bfc 100644
--- a/src/character_attire.cpp
+++ b/src/character_attire.cpp
@@ -869,6 +869,15 @@ bool outfit::is_worn( const itype_id &clothing ) const
return false;
}
+bool outfit::is_worn_module( const item &thing ) const
+{
+ return thing.has_flag( flag_CANT_WEAR ) &&
+ std::any_of( worn.cbegin(), worn.cend(), [&thing]( item const & elem ) {
+ return elem.contained_where( thing ) != nullptr;
+ } );
+}
+
+
bool outfit::is_wearing_on_bp( const itype_id &clothing, const bodypart_id &bp ) const
{
for( const item &i : worn ) {
diff --git a/src/character_attire.h b/src/character_attire.h
index 995ac105fc..e4b6db3d00 100644
--- a/src/character_attire.h
+++ b/src/character_attire.h
@@ -66,6 +66,7 @@ class outfit
explicit outfit( const std::list<item> &items ) : worn( items ) {}
bool is_worn( const item &clothing ) const;
bool is_worn( const itype_id &clothing ) const;
+ bool is_worn_module( const item &thing ) const;
bool is_wearing_on_bp( const itype_id &clothing, const bodypart_id &bp ) const;
bool covered_with_flag( const flag_id &f, const body_part_set &parts ) const;
bool wearing_something_on( const bodypart_id &bp ) const;
diff --git a/src/magic_enchantment.cpp b/src/magic_enchantment.cpp
index 78de807b4a..1673c102a9 100644
--- a/src/magic_enchantment.cpp
+++ b/src/magic_enchantment.cpp
@@ -216,7 +216,8 @@ bool enchantment::is_active( const Character &guy, const item &parent ) const
if( !( active_conditions.first == has::HELD ||
( active_conditions.first == has::WIELD && guy.is_wielding( parent ) ) ||
- ( active_conditions.first == has::WORN && guy.is_worn( parent ) ) ) ) {
+ ( active_conditions.first == has::WORN &&
+ ( guy.is_worn( parent ) || guy.is_worn_module( parent ) ) ) ) ) {
return false;
}
The mutation flag should be in uppercasediff --git a/data/mods/Aftershock/items/armor/exosuit/exosuit_mutations.json b/data/mods/Aftershock/items/armor/exosuit/exosuit_mutations.json
index 57a7aae2f3..9fec47e813 100644
--- a/data/mods/Aftershock/items/armor/exosuit/exosuit_mutations.json
+++ b/data/mods/Aftershock/items/armor/exosuit/exosuit_mutations.json
@@ -8,6 +8,6 @@
"valid": false,
"purifiable": false,
"types": [ "Equipment" ],
- "flags": "wall_cling"
+ "flags": "WALL_CLING"
}
] But the activation conditions aren't loaded properly for some reason
This lets it turn on (and it also needs the worn patch from above)diff --git a/data/mods/Aftershock/items/armor/exosuit/exosuit_modules.json b/data/mods/Aftershock/items/armor/exosuit/exosuit_modules.json
index c89f0f55df..b64eda056c 100644
--- a/data/mods/Aftershock/items/armor/exosuit/exosuit_modules.json
+++ b/data/mods/Aftershock/items/armor/exosuit/exosuit_modules.json
@@ -665,7 +665,7 @@
"material": [ "lvl4ballisticglass", "qt_steel" ],
"symbol": "(",
"color": "yellow",
- "flags": [ "CANT_WEAR", "EXO_HELMET_GADGET" ],
+ "flags": [ "CANT_WEAR", "EXO_HELMET_GADGET", "USE_UPS" ],
"relic_data": {
"passive_effects": [ { "has": "WORN", "condition": "ACTIVE", "values": [ { "value": "LEARNING_FOCUS", "add": 15 } ] } ]
},
These work fine. Not sure how to test the other ones. |
This is what I expected, I think the core issue can be closed at this point. Thanks for taking a look. |
Issue appears to be resolved, remaining exosuit modules to test or debug appear to be item based, not an issue with the core mechanic of worn items. |
Describe the bug
Something in the last few weeks broke most of the exosuit functionality. Flags and relic passive effects no longer work when activated. Transforms still work.
Steps to reproduce
Also impacts modules like the small and large load support modules, which can be reproduced easily.
Expected behavior
Activating a module or the frame itself should provide passive bonus effects.
Screenshots
No response
Versions and configuration
Dark Days Ahead [dda],
Disable NPC Needs [no_npc_food],
No Fungal Growth [no_fungal_growth],
Bionic Professions [package_bionic_professions],
Aftershock [aftershock],
Aftershock: Exoplanet [aftershock_exoplanet]
]
Additional context
Also happens on non-exoplanet worlds, see below
Dark Days Ahead [dda],
Disable NPC Needs [no_npc_food],
No Fungal Growth [no_fungal_growth],
Aftershock [aftershock]
]
The text was updated successfully, but these errors were encountered: