Skip to content

Commit

Permalink
Bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Algor0113 committed Nov 13, 2024
1 parent d69f8ee commit 9d87965
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# TORG Eternity Changelog

## v.12.3.3

- Fixing a bug that fetched attribute maximum for all actor types, though it may take only these for storm knights.
- Fixed the assignment of newly made vehicle avatar & token

## v.12.3.2

- Fixing some standard item-icons related things [#483](https://github.com/gmmatt/torgeternity/issues/483)
Expand Down
4 changes: 2 additions & 2 deletions module/documents/actor/torgeternityActor.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,12 @@ export default class TorgeternityActor extends Actor {

async _preUpdate(changed, options, user) {
const isFullReplace = !((options.diff ?? true) && (options.recursive ?? true));
if (!changed.system || isFullReplace) {
if (!changed.system || isFullReplace || this.type !== 'stormknight') {
return super._preUpdate(changed, options, user);
}

// Apply attribute maximums
for (const [attribute, { maximum }] of Object.entries(this.system.attributes)) {
for (const [attribute, { maximum }] of Object.entries(this?.system?.attributes)) {
const changedAttribute = changed.system.attributes?.[attribute];
if (typeof changedAttribute?.base === 'number') {
const clampedAttribute = Math.clamp(changedAttribute.base, 0, maximum);
Expand Down
4 changes: 2 additions & 2 deletions module/torgeternity.js
Original file line number Diff line number Diff line change
Expand Up @@ -970,8 +970,8 @@ Hooks.on('preCreateActor', (actor, data, options, userId) => {
}
if (data.type === 'vehicle' && actor.img.includes('mystery-man')) {
actor.updateSource({
'prototypeToken.texture.src': 'systems/torgeternity/images/icons/vehicle-Token.webp',
img: 'systems/torgeternity/images/icons/vehicle.webp',
'prototypeToken.texture.src': 'systems/torgeternity/images/characters/vehicle-land-Token.webp',
img: 'systems/torgeternity/images/characters/vehicle-land.webp',
});
}
});
Expand Down

0 comments on commit 9d87965

Please sign in to comment.