Skip to content

Commit f9830aa

Browse files
Partially revert "Stop using pre-apoc price as a fallback for postapoc price" (#82284)
1 parent 4694904 commit f9830aa

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/item_factory.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,10 @@ void Item_factory::finalize_pre( itype &obj )
386386
obj.category_force = calc_category( obj );
387387
}
388388

389+
// use pre-Cataclysm price as default if post-cataclysm price unspecified
390+
if( obj.price_post < 0_cent ) {
391+
obj.price_post = obj.price;
392+
}
389393
// use base volume if integral volume unspecified
390394
if( obj.integral_volume < 0_ml ) {
391395
obj.integral_volume = obj.volume;
@@ -4069,7 +4073,7 @@ void itype::load( const JsonObject &jo, std::string_view src )
40694073
optional( jo, was_loaded, "volume", volume );
40704074
optional( jo, was_loaded, "longest_side", longest_side, -1_mm );
40714075
optional( jo, was_loaded, "price", price, not_negative_money, 0_cent );
4072-
optional( jo, was_loaded, "price_postapoc", price_post, not_negative_money, 0_cent );
4076+
optional( jo, was_loaded, "price_postapoc", price_post, not_negative_money, -1_cent );
40734077
optional( jo, was_loaded, "stackable", stackable_ );
40744078
optional( jo, was_loaded, "integral_volume", integral_volume, not_negative_volume, -1_ml );
40754079
optional( jo, was_loaded, "integral_longest_side", integral_longest_side, not_negative_length,

src/itype.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1515,7 +1515,7 @@ struct itype {
15151515
units::money price = 0_cent;
15161516

15171517
/** Value after the Cataclysm, dependent upon practical usages. Price given is for a default-sized stack. */
1518-
units::money price_post = 0_cent;
1518+
units::money price_post = -1_cent;
15191519

15201520
// TODO: Add some very basic unweildiness calc for non specified to_hit?
15211521
int m_to_hit = -2; // To-hit bonus for melee combat, see GAME_BALANCE.md#to-hit-value

0 commit comments

Comments
 (0)