@@ -818,19 +818,20 @@ export function initConfig() {
818
818
get quantity ( ) {
819
819
if ( ! this . activity ) return null ;
820
820
const showQuantityItemTypes = [ "consumable" ] ;
821
- const consumeType = this . activity . consume ?. type ;
822
- if ( consumeType === "ammo" ) {
823
- const ammoItem = this . actor . items . get ( this . activity . consume . target ) ;
821
+ const consumeType = this . activity ?. consume ?. type ;
822
+ const useAmmo = this . item . system . ammunition ?. type ;
823
+ if ( useAmmo ) {
824
+ const ammoItem = this . item . system . ammunitionOptions [ 0 ] ?. item ;
824
825
if ( ! ammoItem ) return null ;
825
- return Math . floor ( ( ammoItem . quantity ?? 0 ) / this . activity . consume . amount ) ;
826
+ return Math . floor ( ( ammoItem . system . quantity ?? 0 ) ) ;
826
827
} else if ( consumeType === "attribute" ) {
827
828
return Math . floor ( getProperty ( this . actor , this . activity . consume . target ) / this . activity . consume . amount ) ;
828
829
} else if ( consumeType === "charges" ) {
829
830
const chargesItem = this . actor . items . get ( this . activity . consume . target ) ;
830
831
if ( ! chargesItem ) return null ;
831
832
return Math . floor ( ( chargesItem . uses ?. value ?? 0 ) / this . activity . consume . amount ) ;
832
- } else if ( showQuantityItemTypes . includes ( this . activity . type ) ) {
833
- return this . activity . uses ?. value ?? this . activity . quantity ;
833
+ } else if ( showQuantityItemTypes . includes ( this . item . type ) && ! this . activity . uses . max ) {
834
+ return this . item . system . quantity ;
834
835
} else if ( this . activity . uses . value !== null && this . activity . uses . per !== null && this . activity . uses . max ) {
835
836
return this . activity . uses . value ;
836
837
}
0 commit comments