Fixed and improved location resolve in actor editing.

This commit is contained in:
DebaucheryLibrarian 2025-03-06 01:44:12 +01:00
parent 8ada96c8bc
commit 7ad424c389
1 changed files with 6 additions and 2 deletions

View File

@ -947,6 +947,10 @@ function getDeltas(edits, baseActor, options) {
const countryKey = key.includes('origin') ? 'originCountry' : 'residenceCountry'; const countryKey = key.includes('origin') ? 'originCountry' : 'residenceCountry';
if (!resolvedLocation.country) {
return null;
}
return [ return [
{ {
key: countryKey, key: countryKey,
@ -957,11 +961,11 @@ function getDeltas(edits, baseActor, options) {
}, },
{ {
key: key.includes('origin') ? 'originState' : 'residenceState', key: key.includes('origin') ? 'originState' : 'residenceState',
value: resolvedLocation.state, value: resolvedLocation.state || null, // explicitly unset to prevent outcomes like Los Angeles, Greenland
}, },
{ {
key: key.includes('origin') ? 'originCity' : 'residenceCity', key: key.includes('origin') ? 'originCity' : 'residenceCity',
value: resolvedLocation.city, value: resolvedLocation.city || null,
}, },
]; ];
} }